Advertisement
Guest User

Untitled

a guest
Dec 19th, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. <?php
  2. session_start();
  3. $ulist = file_get_contents("/opt/ulist.txt");
  4.  
  5. ?>
  6. <html>
  7. <body>
  8. <?php
  9. if(isset($_POST['user']) && isset($_POST['pass'])){
  10. $user = $_POST['user'];
  11. $pass = $_POST['pass'];
  12.  
  13. if(strpos($ulist, $user) !== false){
  14. if($user == "" && $pass == "") {
  15. $_SESSION['valid'] = true;
  16. }
  17. else {
  18. echo 'Wrong username or password.';
  19. }
  20. } else
  21. {
  22. echo 'Wrong username or password..';
  23. }
  24. }
  25. if(!$_SESSION['valid']){
  26. echo '
  27. <form action="index.php" method="post">
  28. <input type="text" name="user" /><br />
  29. <input type="password" name="pass" /><br />
  30. <input type="submit" value="Log in" />
  31. </form>';
  32. }
  33. ?>
  34. </body>
  35. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement