View Single Post
Old 09-24-2008, 07:56 PM   #6 (permalink)
CrazeD
CrazeD's Avatar
 
Wizard Techie

Join Date: Feb 2006

Location: Maine

Posts: 3,720

CrazeD will become famous soon enoughCrazeD will become famous soon enough

Default Re: Login and passwords

PHP Code:
<?php

if (isset ($_POST['submit'])) {
    
$username $_POST['username'];
    
$password $_POST['password'];

    if (
$username == 'user' && $password == 'pass') {
        echo 
'logged in';
    } else {
        echo 
'Incorrect username/password!';
    }
} else {
    echo 
'<form action="index.php" method="post">
    Username: <input type="text" name="username" /><br />
    Password: <input type="password" name="password" /><br />
    <input type="submit" name="submit" value="Login" />
    </form>'
;
}

?>
Change 'user' and 'pass' to whatever you want.

Extremely simple version.
__________________

Intel Q9400 | Gigabyte EP45-UD3P | G.Skill 2x2GB DDR2 1000 | XFX HD5870

Need website help? PM me!
CrazeD is offline