Guest User

Untitled

a guest
Oct 17th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. <html>
  2. <head>
  3. <title>Login</title>
  4. </head>
  5. <body>
  6. <center><?php include 'config.php'; ?>
  7. <form method="POST" action="Login.php">
  8. Username: <input type="text" name="user" value = "Username" /><br/>
  9. Password: <input type="text" name="pass" value = "Password" /><br/>
  10.  
  11. <br/>
  12. <input type="submit" name="Login" />
  13. </form></div>
  14. <?php
  15. if(isset($_POST["user"]) && isset($_POST["pass"])){
  16.  
  17. $user = $_POST["user"];
  18. $pass = $_POST["pass"];
  19. $user = stripslashes($user);
  20. $pass = stripslashes($pass);
  21. $user = mysql_real_escape_string($user);
  22. $pass = mysql_real_escape_string($pass);
  23.  
  24. $result = mysql_query(" SELECT * FROM Users WHERE username ='$user' AND password ='$pass'");
  25. $success=mysql_num_rows($result);
  26.  
  27. if($success == 0){
  28. echo "Username/Password doesn't exist";
  29. }
  30. else{
  31. echo "You've successfully logged in as $user";
  32.  
  33.  
  34. }
  35.  
  36. }
  37.  
  38.  
  39.  
  40. ?>
  41. </body>
  42. </html>
Add Comment
Please, Sign In to add comment