Advertisement
Guest User

Untitled

a guest
Apr 15th, 2019
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.58 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4.  
  5. <style>
  6. input[type=text] {
  7.     border: 2px solid blue;
  8.     border-radius: 4px;
  9.     background-color: #3CBC8D;
  10.     color: black;
  11.     }
  12.    
  13.     input[type=email] {
  14.     border: 2px solid blue;
  15.     border-radius: 4px;
  16.     }
  17.    
  18.     body{
  19.     background-image:
  20.     url("peni.jpg");
  21.     background-size: 1800px 760px;
  22.     }
  23.    
  24.    
  25. </style>
  26.  
  27. </head>
  28. <body bgcolor=#00b3b3>
  29. <font>
  30. <center><h1>login</h1></center>
  31. </font>
  32. <center><br>
  33. <form action="login.php" method="POST">
  34. Username:<br><input type="text" name="uname"><br></br>
  35. Password:<br><input type="email" name="pass"><br>
  36. <br><input type="Submit" value="login"name="submit">
  37. </form>
  38. </center></br>
  39. </body>
  40. </head>
  41. </html>
  42.  
  43. |
  44. |
  45. |
  46. |
  47. v
  48.  
  49. <?php
  50. require('sql_connect.php');
  51. if(isset($_POST['submit']))
  52. {
  53. $username=mysql_escape_string($_POST['uname']);
  54. $password=mysql_escape_string($_POST['pass']);
  55. if(!$_POST['uname'] | !$_POST['pass'])
  56.    {
  57.    echo("<SCRIPT LANGUAGE='JavaScript'>
  58.         window.alert('You did not complete all of the required fields')
  59.         window.location.href='htmllogin.html'
  60.         </SCRIPT>");
  61.    exit();
  62.    }
  63.    $sql= mysql_query("SELECT * FROM `login_users` WHERE `username` = '$username' AND `password` ='$password'");
  64.     if(mysql_num_rows($sql) > 0)
  65.     {
  66.     echo ("<SCRIPT LANGUAGE='JavaScript'>
  67.         window.alert('Login Succesfully!.')
  68.         window.location.href='htmllogin.html'
  69.         </SCRIPT>");
  70.     exit();
  71.     }
  72.  
  73.     else{
  74.     echo("<SCRIPT LANGUAGE='JavaScript'>
  75.         window.alert('Wrong username password combination.Please re-enter')
  76.         window.location.href='htmllogin.html'
  77.         </SCRIPT>");
  78.     exit();
  79.     }
  80. }
  81. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement