Guest User

Untitled

a guest
Dec 9th, 2018
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. <?php
  2. if(isset($_POST['btnsubmit']))
  3. {
  4.  
  5. if($_POST['username'] == "test" . "admin")
  6. {
  7. echo "username correct!<br/>";
  8. $user = true;
  9.  
  10. }
  11. else
  12. {
  13. echo "username wrong!<br/>";
  14. $user = FALSE;
  15. }
  16. if($_POST['password'] == "test" . "admin")
  17. {
  18. echo "password correct!<br/>";
  19. $pass = true;
  20. }
  21. else
  22. {
  23. echo "password failed!<br/>";
  24. $pass = FALSE;
  25. }
  26. if($user == TRUE && $pass == TRUE)
  27. {
  28. echo "Login succeded!";
  29. echo "<meta HTTP-EQUIV='REFRESH' content='5; url= www.google.com'>";
  30. }
  31. else
  32. {
  33. echo "Login failed";
  34. echo '<script type="text/javascript">'
  35. , 'history.go(-1);'
  36. , '</script>'
  37. ;
  38. }
  39. }
  40. ?>
  41.  
  42. $users = Array("admin" => "admin", "test" => "test");
  43.  
  44. if(isset($users[$_POST['username']]))
  45. ...
  46. if($users[$_POST['username']] == $_POST['password'])
  47.  
  48. echo '<script type="text/javascript">'
  49. , 'history.go(-1);'
  50. , '</script>'
  51. ;
  52.  
  53. echo '<script type="text/javascript">'
  54. . 'history.go(-1);'
  55. . '</script>'
  56. ;
  57.  
  58. if($user == TRUE && $pass == TRUE)
  59. {
  60. echo "Login succeded!";
  61. echo "<meta HTTP-EQUIV='REFRESH' content='5; url= https://www.google.com'>";
  62. }
Add Comment
Please, Sign In to add comment