<?php
session_start();
include('../includes/header.php');
error_reporting(E_ALL);
ini_set('display_errors', 1);
echo("<h1>Simple Login</h1>");
// get values
$step = isset($_POST['step']) ? $_POST['step'] : 0;
$name = isset($_POST['name']) ? $_POST['name'] : '';
// clean input
$name = htmlentities($name);
if ($step == 0)
{
?>
<form action="login_page1.php" method="POST" class="pad">
<p>Enter your name to "log in":</p>
<label for="name">Name:</label>
<input type="text" name="name" id="name" size="25">
<br><br>
<input type="hidden" name="step" value="1">
<input type="submit" value="Login">
</form>
<?php
}
else
{
// store in session
$_SESSION['name'] = $name;
echo("<p>You are now logged in as <strong>$name</strong>.</p>");
echo('<p><a href="login_page2.php">Go to Welcome Page</a></p>');
}
include('../includes/footer.php');
?>