ssharma

indexx

Oct 9th, 2019
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 6.82 KB | None | 0 0
  1. <?php
  2. session_start();
  3. ?>
  4. <html>
  5. <head>
  6. <style>
  7. ::-webkit-scrollbar{display:none;}
  8. body{overflow:hidden;background-image:url(animal-bright-bunny-372166.jpg);background-size:100% 100%;background-attachment:fixed;}
  9. .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%);}
  10. .proflepic{transition-duration:1s;position:absolute;border-radius:100%;height:100%;width:100%;}
  11. .profileframe{overflow:hidden;position:absolute;left:35%;top:10%;border-radius:100%;height:40%;width:30%;border:3px solid green;}
  12. .nametag{color:white;position:absolute;top:50%;width:100%;text-align:center;}
  13. .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;}
  14. .field:hover{border:none;box-shadow:0px 0px 20px skyblue;}
  15. .submit{position:absolute;top:70%;right:25%;width:10%;height:10%;font-size:1.1em;border-radius:0px 10px 10px 0px;}
  16. .submits{background:green;border:none;color:gold;font-size:1.1em;}
  17. .submit:hover{box-shadow:0px 0px 20px gold;}
  18. .submits:hover{box-shadow:0px 0px 20px gold;}
  19. .contact_Link{position:absolute;margin:0px;padding:0px;width:100%;text-align:center;bottom:5%;color:yellow;font-size:20px;}
  20. .contact_Link:hover span{cursor:pointer;color:white;text-shadow:0px 0px 20px gold;}
  21.  
  22.  
  23. .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%);}
  24. .headline{text-align:center;width:100%;font-size:20px;font-family:tahoma;color:gold;}
  25. .regfield{width:90%;height:40px;outline:none;margin:5px;border-radius:10px;border:none;}
  26. .regfield:hover{box-shadow:0px 0px 20px skyblue;}
  27. .leftspace{padding-left:20px;font-size:1.1em;}
  28. .regi{width:90%;height:40px;outline:none;margin:5px;border-radius:10px;border:none;}
  29. .floral{background-image:radial-gradient(gold -80%, transparent 70%);height:80px;width:100%;}
  30. .floralimg{height:100%;}
  31. </style>
  32. </head>
  33. <body onload="intro();">
  34. <div class="mainform" id="maindiv">
  35. <form method="post">
  36. <input class="field" type="text" name="username">
  37. <input class="submit submits" type="submit" name="letsee" value="Find">
  38. <p class="contact_Link"><span onclick="regform_appear();">I Dont Have any Account..!!!</span></p>
  39. </form>
  40. <?php
  41. if(isset($_POST['letsee']))
  42. {
  43.     $dbc=mysqli_connect('localhost','root','','whatsapp');
  44.     $username=mysqli_real_escape_string($dbc,$_POST['username']);
  45.     $q="SELECT * FROM contacts WHERE username='$username'";
  46.     $r=mysqli_query($dbc,$q);
  47.     $rows=mysqli_num_rows($r);
  48.     if($rows>=1)
  49.     {
  50.         while($row=mysqli_fetch_array($r,MYSQLI_ASSOC))
  51.         {
  52.             echo "<div class='profileframe'><img class='proflepic' src=".$row['image']."></div>";
  53.             echo "<h1 class='nametag'>".$row['username']."</h1>";
  54.             $_SESSION['username']=$row['username'];
  55.             $_SESSION['password']=$row['password'];
  56.             $_SESSION['image']=$row['image'];
  57.             $_SESSION['about']=$row['about'];
  58.             $_SESSION['contact']=$row['contact'];
  59.            
  60.             echo '<form method="post">
  61.                     <input class="field" type="password" name="password">
  62.                     <input class="submit submits" type="submit" name="log" value="login">
  63.                     </form>';
  64.         }
  65.     }
  66.     else
  67.     {
  68.         echo "<div class='profileframe'><img class='proflepic' src=''></div>";
  69.     }
  70.     mysqli_close($dbc);
  71. }
  72. ?>
  73.  
  74. <?php
  75. if(isset($_POST['log']))
  76. {
  77.     $dbc=mysqli_connect('localhost','root','','whatsapp');
  78.     $username=mysqli_real_escape_string($dbc,$_SESSION['username']);
  79.     $password=mysqli_real_escape_string($dbc,$_POST['password']);
  80.     $q="SELECT * from contacts WHERE username='$username' && password=SHA1('$password')";
  81.     $r=mysqli_query($dbc,$q);
  82.     $rows=mysqli_num_rows($r);
  83.     if($rows==1)
  84.     {
  85.         header('location:whatsapp.php');
  86.     }
  87.     else
  88.     {
  89.         echo "error";
  90.     }
  91.     mysqli_close($dbc);
  92. }
  93. ?>
  94. </div>
  95.  
  96. <div id="regform" class="regform">
  97. <form method="post" enctype="multipart/form-data">
  98. <h1 class="headline">CREATE YOUR NEW ACCOUNT</h1>
  99. <input type="text" name="username" class="regfield leftspace" placeholder="Username Here..!!!">
  100. <input type="text" name="password" class="regfield leftspace" placeholder="Password">
  101. <input type="text" name="about" class="regfield leftspace" placeholder="About">
  102. <input type="text" name="gender" class="regfield leftspace" placeholder="Gender">
  103. <input type="text" name="contact" class="regfield leftspace" placeholder="Contact No">
  104. <input type="file" name="image" class="regfield" placeholder="Image for the Profile">
  105. <input type="submit" name="register" class="regi submits" value="Register">
  106. <div  class="floral"><img class="floralimg" src="floral-1751088.svg"></div>
  107. </form>
  108. </div>
  109. <?php
  110.  
  111. if(isset($_POST['register']))
  112. {
  113.     $dbc=mysqli_connect("localhost","root","","whatsapp");
  114.     $username=mysqli_real_escape_string($dbc, $_POST['username']);
  115.     $password=mysqli_real_escape_string($dbc, $_POST['password']);
  116.     $about=mysqli_real_escape_string($dbc, $_POST['about']);
  117.     $gender=mysqli_real_escape_string($dbc, $_POST['gender']);
  118.     $contact=mysqli_real_escape_string($dbc, $_POST['contact']);
  119.     $image="userdata/".$_FILES['image']['name'];
  120.     move_uploaded_file($_FILES['image']['tmp_name'],$image);
  121.     $imgpath=mysqli_real_escape_string($dbc,$image);
  122.    
  123.     $q1="INSERT INTO contacts(username,password,about,gender,contact,image) VALUES('$username',SHA1('$password'),'$about','$gender','$contact','$imgpath')";
  124.     mysqli_query($dbc,$q1);
  125.  
  126.    
  127.     $table=str_replace(" ","",$username)."_".$contact."_chat";
  128.     $q2="CREATE TABLE $table(
  129.     id INT(11) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
  130.     message VARCHAR(200) NOT NULL,
  131.     messagetime VARCHAR(200) NOT NULL,
  132.     reply VARCHAR(200) NOT NULL,
  133.     replytime VARCHAR(200) NOT NULL
  134.     )";
  135.     mysqli_query($dbc,$q2);
  136.     mysqli_close($dbc);
  137. }
  138. ?>
  139.  
  140. <script>
  141. function intro()
  142. {
  143.     document.getElementById('maindiv').style.left='30%';
  144.     document.getElementById('maindiv').style.top='20%';
  145.     document.getElementById('maindiv').style.transform='rotate(360deg)';
  146.     document.getElementById('maindiv').style.borderRadius='8px';
  147.     document.getElementById('maindiv').style.width='40%';
  148.     document.getElementById('maindiv').style.height='60%';
  149. }
  150.  
  151. function regform_appear()
  152. {
  153.     document.getElementById('maindiv').style.opacity='0';
  154.     setTimeout(a,1000);
  155.     function a()
  156.     {
  157.         document.getElementById('maindiv').style.display='none';
  158.         document.getElementById('regform').style.opacity='1';
  159.         document.getElementById('regform').style.left='30%';
  160.         document.getElementById('regform').style.top='10%';
  161.         document.getElementById('regform').style.transform='rotate(360deg)';
  162.         document.getElementById('regform').style.borderRadius='10px';
  163.         document.getElementById('regform').style.width='40%';
  164.         document.getElementById('regform').style.height='80%';
  165.     }
  166.    
  167.  
  168.    
  169. }
  170. </script>
  171. </body>
  172. </html>
Add Comment
Please, Sign In to add comment