Advertisement
Guest User

Untitled

a guest
Apr 10th, 2016
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. <?php
  2. session_start();
  3. if(isset($_SESSION["admin"])){
  4. header("Location: admin.php");
  5. }
  6. if(isset($_POST["submit"])){
  7. if(empty($_POST["username"])){
  8. echo 'Username required';
  9. }
  10. if(empty($_POST["password"])){
  11. echo 'Password required';
  12. }
  13. $username = $_POST["username"];
  14. $password = $_POST["password"];
  15.  
  16. if(file_exists("users/".$username.".txt")){
  17. $file = "users/". $username .".txt";
  18. $password = 'password';
  19. } else {
  20. echo 'You are not the admin of this site';
  21. }
  22. }
  23. ?>
  24. <!DOCTYPE html>
  25. <html>
  26. <head>
  27. <title>BukkitPE Login Page</title>
  28. <style type="text/css">
  29. a{
  30. text-decoration:none;
  31. }
  32. </style>
  33. </head>
  34. <body>
  35.  
  36. <nav><font size="3"><a href="index.php">Home</a></font></nav><br><br>
  37.  
  38. <fieldset style="width:30%"><legend>Login</legend>
  39. <form action="login.php" method="post">
  40. <label for="username">Name:</label><br>
  41. <input type="text" name="username" /><br>
  42. <label for="password">Password:</label><br>
  43. <input type="password" name="password" /><br>
  44. <input type="submit" value="Submit" name="submit"/>
  45. </form>
  46. </fieldset>
  47. </center>
  48. </body>
  49. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement