View Single Post
Old 07-23-2006, 06:32 PM   PM User | #2
xanderman
New Coder

 
Join Date: May 2006
Location: Pennsylvania, USA
Posts: 31
Thanks: 0
Thanked 4 Times in 4 Posts
xanderman is an unknown quantity at this point
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
}
?>
xanderman is offline   Reply With Quote