Guest User

Untitled

a guest
Jan 23rd, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. <?php
  2.  
  3. //include connection file
  4.  
  5. include('connect.php');
  6.  
  7. //sanitize input
  8.  
  9. $username = (strip_tags($_POST['username']));
  10. $password = (strip_tags($_POST['password']));
  11.  
  12. //check password and username are correct
  13.  
  14. if($username&&$password) {
  15.  
  16. if(isset($_POST['submit'])) {
  17.  
  18. if($username==$dbusername&&$password==$dbpassword) {
  19.  
  20. echo "You have successfully logged in";
  21.  
  22. } else {
  23.  
  24. echo "The username and password you entered is incorrect";
  25.  
  26. }
  27.  
  28.  
  29. } else {
  30.  
  31. echo "You did not complete the form";
  32.  
  33. }
  34.  
  35. } else {
  36.  
  37. echo "You did not enter a username or password";
  38.  
  39. }
  40.  
  41.  
  42. ?>
Add Comment
Please, Sign In to add comment