Advertisement
Guest User

Untitled

a guest
Feb 1st, 2013
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. <?php
  2.  
  3. session_start();
  4.  
  5. if ($_GET['login']) {
  6. // Only load the code below if the GET
  7. // variable 'login' is set. You will
  8. // set this when you submit the form
  9.  
  10. if ($_POST['entryphrase'] == 'enter') {
  11. // Load code below if both username
  12. // and password submitted are correct
  13.  
  14. $_SESSION['loggedin'] = 1;
  15. // Set session variable
  16.  
  17. header("Location: protected.php");
  18. exit;
  19. // Redirect to a protected page
  20.  
  21. } else echo "Wrong details";
  22. // Otherwise, echo the error message
  23.  
  24. }
  25.  
  26. $array = array('fire', 'fine', 'fire', 'file', 'fine');
  27. print_r($array);
  28.  
  29. ?>
  30.  
  31. <form action="?login=1" method="post">
  32. <input type="text" name="entryphrase" />
  33. </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement