All in one index login Template

Step 3. Member Area

Login Successful after step 2 below.

Logout"; } elseif(!empty($_POST['username']) && !empty($_POST['password'])) { echo "

Step 2. Processing.

"; echo "

If login successful, it will move to step 3. Member Area.

"; echo "

If login failed, it will move to Step 1. Login Form Area.

"; $username = $_POST['username']; //collect value of input field $password = $_POST['password']; //collect value of input field if (($username != "test") || ($password != "test")) { echo "

Login failed. Name is empty or Username/password does not match!

"; } else { //$username and $password=="test"--> This case, user passed authentication process. $_SESSION["Username"] = $username; // Now we Set a SESSION variable $_SESSION['Loggedin'] = 1; // Now we set another SESSION variable for successful. echo "

Login Successful!

"; echo "Session variables are set."; } echo ""; //will move in 3 sec. echo "

please click here to try again.

"; } else { ?>

Step 1. Login Form Area

First Visiting time, Authentication failed including empty username or password.

When you click submit button, it will go step 2. processing.

*Use both UserName and Password as "test".
UserName:
Password: