PROGRAM IN ACTION
CODE for login1.php
<!--Just replace c_login2_php.php with your authentication page-->
<form action="c_login2_php.php" method="post">
Username: <input type="text" name="username" id="username" />
<br />
Password: <input type="password" name="password" id="password" />
<br />
<input type="submit" value="Login" /><input type="reset" value="Reset" />
</form>
CODE for login2.php
<?php
$username = $_POST['username'];
$password = $_POST['password'];
if ($username == "admin" && $password == "enterthecamel" or $_SESSION['authed'] === TRUE) {
$_SESSION['authed'] = TRUE;
echo "<center>Welcome, AstroCamel admin.<//center>";
}
else {
echo "<center>Wrong login.<//center>";
$_SESSION['authed'] = FALSE;
}
?>