Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //allows the saving of username and password for users that have entered them before
- session_start();
- //using !isset means "if not set"
- //if statement to display text if the user has entered the login form
- if (isset($_POST["email"]) and isset($_POST["password"]))
- {
- //variables that recieve the username and password input from the login form
- $username = $_POST["email"];
- $password = $_POST["password"];
- //outputs the user name and password
- //br tag is used to display text on the next line
- echo $username;
- echo "<br>";
- echo $password;
- echo "<br>";
- //if statement to check if the user has input thier username or password correctly
- //sends user to admin.php if user enteres the login correctly
- if($username == "me@me.com" and $password == "password")
- {
- echo "correct :>";
- $_SESSION["auth"]="admin";
- header("Location: admin.php");
- }
- else
- {
- echo "invalid username or password :<";
- }
- else
- {
- header("Location:form.html");
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement