Here.
PHP Code:
<?php
// Define your username and password
$username = "someuser";
$password = "somepassword";
//Now lets check to see if the form has been filled out.
if(isset($_POST['user']) && isset($_POST['password']))
{
//ok they are set lets see if they match.
if($username == $_POST['user'] && $password == $_POST['password'])
{
//Ok the login worked
?>
Your Protected Page Here.
<?php
}
else
{
//Login Failed, display error
die("Your Login Information was Incorrect");
}
}
else
{
//Login Field was blank, display the login form
?>
Your Login Form Here
<?php
}
?>