Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- if ($_GET['login']) {
- // Only load the code below if the GET
- // variable 'login' is set. You will
- // set this when you submit the form
- if ($_POST['entryphrase'] == 'enter') {
- // Load code below if both username
- // and password submitted are correct
- $_SESSION['loggedin'] = 1;
- // Set session variable
- header("Location: protected.php");
- exit;
- // Redirect to a protected page
- } else echo "Wrong details";
- // Otherwise, echo the error message
- }
- $array = array('fire', 'fine', 'fire', 'file', 'fine');
- print_r($array);
- ?>
- <form action="?login=1" method="post">
- <input type="text" name="entryphrase" />
- </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement