SHARE
TWEET

Untitled

a guest Oct 17th, 2017 48 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top