Guest User

Untitled

a guest
Jun 21st, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. <html>
  2. <head>
  3. <title>
  4. </title>
  5. </head>
  6. <style>
  7. body{
  8. background-color:#DCDCDC;
  9. margin:0px;
  10. }
  11. #page{
  12. background-color:white;
  13. border:5px solid white;
  14. width:75%;
  15. margin-left:auto;
  16. margin-right:auto;
  17. padding:15px;
  18.  
  19.  
  20.  
  21. }
  22. #regi{
  23. margin:0px;
  24. padding:0px;
  25. margin-left:500px;
  26. margin-right:auto;
  27.  
  28.  
  29.  
  30. }
  31.  
  32.  
  33. </style>
  34. <body>
  35. <div id="page">
  36. <h1 align="center">LOGIN</h1>
  37. </div>
  38.  
  39. <form method="POST">
  40. <?php
  41.  
  42.  
  43. $con=mysql_connect('localhost','root') or die('error');
  44. $query=mysql_select_db('login',$con);
  45.  
  46. if(isset($_POST['submit'])){
  47. $aw=$_POST['username'];
  48. $we=$_POST['password'];
  49. $sql=mysql_query("SELECT * FROM login_tbl WHERE username = '$aw' && password = '$we'");
  50. while($rows=mysql_fetch_array($sql));
  51. $user=$rows['username'];
  52. $pass=$rows['password'];
  53. if($user==$aw && $pass==$we){
  54. echo 'login';
  55.  
  56. }
  57. else{
  58. echo 'doesnt match';
  59. }
  60.  
  61.  
  62. }
  63.  
  64.  
  65. ?>
  66.  
  67. <br>
  68. <br>
  69. <br>
  70. <br>
  71. <div id ="regi">
  72. USERNAME:<input type="text" name="username">
  73. <br/>
  74. PASSWORD:<input type="password" name="password">
  75. <br/>
  76. <input type="submit" name="submit" value="submit">
  77. </div>
  78. </form>
  79.  
  80. </body>
  81. </html>
Add Comment
Please, Sign In to add comment