Guest User

Untitled

a guest
May 24th, 2018
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4. * Crappy login script.
  5. */
  6. $username = "administrator";
  7. $password = "testing";
  8.  
  9. if( !empty( $_POST['login'] ) )
  10. {
  11. if( $_POST['user'] == $username )
  12. {
  13. if( $_POST['pass'] == $password )
  14. {
  15. //give session to user
  16. //redirect to admin page
  17. echo "you are now logged in";
  18. } else {
  19. //throw error
  20. echo "incorrect username";
  21. }
  22. } else {
  23. //throw error
  24. echo "incorrect username";
  25. }
  26. } else
  27. ?>
  28. <form action="" method="post" >
  29. Username: <input type="text" name="user" /><br />
  30. Password: <input type="text" name="pass" /><br />
  31. <input type="hidden" name="login" value="true" />
  32. <input type="submit" value="Log In!" />
  33. </form>
Add Comment
Please, Sign In to add comment