 |
| ::: T4VN Statistics ::: |
PHP Scripts : 64 |
PHP Example : 67 |
PHP Tutorials : 21 |
PHP News : 93 |
Total Coupon : 36 |
Other Tutorials : |
Member : 215 |
Visitor Online : 2 |
Today Visit: 264 |
Total Visitor : 301286 |
Most Online : 41 |
|
 |
 |
Easy Simple Password Protector
Author : Andrew Danks
Need a simple protection to a file that requires a password? Here's one! Contact me if you need help!
| PHP Example : | | <?
/*
Code Written by Andrew Danks
www.solinweb.net
*/
//The password form field must be named "password".
//Casing matters! i.e. ThiS isn't the same as this
$thepassword="password";
//Message when user doesn't enter a password
$nopw="You didn't enter a password knucklehead!";
//Success page when password is correct
$success="success.php";
//Message when Uuser enters wrong password
$wrongpw="Wrong Password!";
//DO NOT EDIT BELOW UNLESS YOU ARE FAMILIAR
//WITH PHP!!!!
//-------------------------------------------------------------------------------
if(!$password){
echo $nopw;
exit();
}
if($password==$thepassword) {
Header("Location: $success");
}
else {
echo $wrongpw;
}
?>
| |
| |

|
 |
| ::: Resources ::: |
|
|
| ::: New Templates ::: |
|
| ::: Other Tutorials ::: |
|
 |