Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- ?>
- <html>
- <head>
- <style>
- ::-webkit-scrollbar{display:none;}
- body{overflow:hidden;background-image:url(animal-bright-bunny-372166.jpg);background-size:100% 100%;background-attachment:fixed;}
- .mainform{transition-duration:1s;transition-timing-function:ease-in-out;position:absolute;left:72.5%;top:35%;border-radius:100%;width:0px;height:0px;background-image:radial-gradient(black -60%, transparent 600%);}
- .proflepic{transition-duration:1s;position:absolute;border-radius:100%;height:100%;width:100%;}
- .profileframe{overflow:hidden;position:absolute;left:35%;top:10%;border-radius:100%;height:40%;width:30%;border:3px solid green;}
- .nametag{color:white;position:absolute;top:50%;width:100%;text-align:center;}
- .field{padding-left:10px;font-size:1.1em;position:absolute;top:70%;left:25%;width:40%;height:10%;outline:none;border-radius:10px 0px 0px 10px;}
- .field:hover{border:none;box-shadow:0px 0px 20px skyblue;}
- .submit{position:absolute;top:70%;right:25%;width:10%;height:10%;font-size:1.1em;border-radius:0px 10px 10px 0px;}
- .submits{background:green;border:none;color:gold;font-size:1.1em;}
- .submit:hover{box-shadow:0px 0px 20px gold;}
- .submits:hover{box-shadow:0px 0px 20px gold;}
- .contact_Link{position:absolute;margin:0px;padding:0px;width:100%;text-align:center;bottom:5%;color:yellow;font-size:20px;}
- .contact_Link:hover span{cursor:pointer;color:white;text-shadow:0px 0px 20px gold;}
- .regform{padding:1% 0%;overflow-y:scroll;opacity:0;transition-duration:1s;text-align:center;position:absolute;left:72.5%;top:35%;border-radius:100%;width:0px;height:0px;background-image:radial-gradient(black -60%, transparent 600%);}
- .headline{text-align:center;width:100%;font-size:20px;font-family:tahoma;color:gold;}
- .regfield{width:90%;height:40px;outline:none;margin:5px;border-radius:10px;border:none;}
- .regfield:hover{box-shadow:0px 0px 20px skyblue;}
- .leftspace{padding-left:20px;font-size:1.1em;}
- .regi{width:90%;height:40px;outline:none;margin:5px;border-radius:10px;border:none;}
- .floral{background-image:radial-gradient(gold -80%, transparent 70%);height:80px;width:100%;}
- .floralimg{height:100%;}
- </style>
- </head>
- <body onload="intro();">
- <div class="mainform" id="maindiv">
- <form method="post">
- <input class="field" type="text" name="username">
- <input class="submit submits" type="submit" name="letsee" value="Find">
- <p class="contact_Link"><span onclick="regform_appear();">I Dont Have any Account..!!!</span></p>
- </form>
- <?php
- if(isset($_POST['letsee']))
- {
- $dbc=mysqli_connect('localhost','root','','whatsapp');
- $username=mysqli_real_escape_string($dbc,$_POST['username']);
- $q="SELECT * FROM contacts WHERE username='$username'";
- $r=mysqli_query($dbc,$q);
- $rows=mysqli_num_rows($r);
- if($rows>=1)
- {
- while($row=mysqli_fetch_array($r,MYSQLI_ASSOC))
- {
- echo "<div class='profileframe'><img class='proflepic' src=".$row['image']."></div>";
- echo "<h1 class='nametag'>".$row['username']."</h1>";
- $_SESSION['username']=$row['username'];
- $_SESSION['password']=$row['password'];
- $_SESSION['image']=$row['image'];
- $_SESSION['about']=$row['about'];
- $_SESSION['contact']=$row['contact'];
- echo '<form method="post">
- <input class="field" type="password" name="password">
- <input class="submit submits" type="submit" name="log" value="login">
- </form>';
- }
- }
- else
- {
- echo "<div class='profileframe'><img class='proflepic' src=''></div>";
- }
- mysqli_close($dbc);
- }
- ?>
- <?php
- if(isset($_POST['log']))
- {
- $dbc=mysqli_connect('localhost','root','','whatsapp');
- $username=mysqli_real_escape_string($dbc,$_SESSION['username']);
- $password=mysqli_real_escape_string($dbc,$_POST['password']);
- $q="SELECT * from contacts WHERE username='$username' && password=SHA1('$password')";
- $r=mysqli_query($dbc,$q);
- $rows=mysqli_num_rows($r);
- if($rows==1)
- {
- header('location:whatsapp.php');
- }
- else
- {
- echo "error";
- }
- mysqli_close($dbc);
- }
- ?>
- </div>
- <div id="regform" class="regform">
- <form method="post" enctype="multipart/form-data">
- <h1 class="headline">CREATE YOUR NEW ACCOUNT</h1>
- <input type="text" name="username" class="regfield leftspace" placeholder="Username Here..!!!">
- <input type="text" name="password" class="regfield leftspace" placeholder="Password">
- <input type="text" name="about" class="regfield leftspace" placeholder="About">
- <input type="text" name="gender" class="regfield leftspace" placeholder="Gender">
- <input type="text" name="contact" class="regfield leftspace" placeholder="Contact No">
- <input type="file" name="image" class="regfield" placeholder="Image for the Profile">
- <input type="submit" name="register" class="regi submits" value="Register">
- <div class="floral"><img class="floralimg" src="floral-1751088.svg"></div>
- </form>
- </div>
- <?php
- if(isset($_POST['register']))
- {
- $dbc=mysqli_connect("localhost","root","","whatsapp");
- $username=mysqli_real_escape_string($dbc, $_POST['username']);
- $password=mysqli_real_escape_string($dbc, $_POST['password']);
- $about=mysqli_real_escape_string($dbc, $_POST['about']);
- $gender=mysqli_real_escape_string($dbc, $_POST['gender']);
- $contact=mysqli_real_escape_string($dbc, $_POST['contact']);
- $image="userdata/".$_FILES['image']['name'];
- move_uploaded_file($_FILES['image']['tmp_name'],$image);
- $imgpath=mysqli_real_escape_string($dbc,$image);
- $q1="INSERT INTO contacts(username,password,about,gender,contact,image) VALUES('$username',SHA1('$password'),'$about','$gender','$contact','$imgpath')";
- mysqli_query($dbc,$q1);
- $table=str_replace(" ","",$username)."_".$contact."_chat";
- $q2="CREATE TABLE $table(
- id INT(11) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
- message VARCHAR(200) NOT NULL,
- messagetime VARCHAR(200) NOT NULL,
- reply VARCHAR(200) NOT NULL,
- replytime VARCHAR(200) NOT NULL
- )";
- mysqli_query($dbc,$q2);
- mysqli_close($dbc);
- }
- ?>
- <script>
- function intro()
- {
- document.getElementById('maindiv').style.left='30%';
- document.getElementById('maindiv').style.top='20%';
- document.getElementById('maindiv').style.transform='rotate(360deg)';
- document.getElementById('maindiv').style.borderRadius='8px';
- document.getElementById('maindiv').style.width='40%';
- document.getElementById('maindiv').style.height='60%';
- }
- function regform_appear()
- {
- document.getElementById('maindiv').style.opacity='0';
- setTimeout(a,1000);
- function a()
- {
- document.getElementById('maindiv').style.display='none';
- document.getElementById('regform').style.opacity='1';
- document.getElementById('regform').style.left='30%';
- document.getElementById('regform').style.top='10%';
- document.getElementById('regform').style.transform='rotate(360deg)';
- document.getElementById('regform').style.borderRadius='10px';
- document.getElementById('regform').style.width='40%';
- document.getElementById('regform').style.height='80%';
- }
- }
- </script>
- </body>
- </html>
Add Comment
Please, Sign In to add comment