Advertisement
Guest User

Untitled

a guest
Dec 13th, 2017
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. <html lang="en">
  2. <head>
  3. <meta charset="UTF-8">
  4. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  5. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  6. <title>Document</title>
  7. </head>
  8. <form method="post" action="index.php">
  9. username:<br/>
  10. <input type="text" name="username"><br/>
  11. password:<br/>
  12. <input type = "password" name="password"><br/>
  13. <input type = "submit" value="Login!">
  14. </form>
  15. <body>
  16.  
  17. </body>
  18. </html>
  19.  
  20.  
  21. <?php
  22.  
  23. session_start();
  24.  
  25. $username = "user";
  26. $password = "password";
  27.  
  28.  
  29. if (isset($_SESSION['Logged_in']) && $_SESSION['Logged_in'] == true){
  30. header("Location: sucess.php");
  31. }
  32.  
  33. if ( isset($_POST['username']) && isset($_POST['password'])) {
  34. if($_POST['username'] == $username && $_POST['password'] == $password)
  35. {
  36. $_SESSION['Logged_in'] = true;
  37. header("Location: sucess.php");
  38.  
  39. }
  40. }
  41.  
  42.  
  43. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement