<?
session_start();
// start password protection code:
// store hash of password
$cmp_pass = md5("password here");
if(!empty($_POST['pass']))
{
// store md5'ed password
$_SESSION['pass'] = md5($_POST['pass']);
}
// if they match, it's ok
if($_SESSION['pass']!=$cmp_pass)
{
// otherwise, give login page
?>
<form action="<?=$_SERVER['PHP_SELF']?>?page=admin-home" method="post">
<h4>Password Protected</h4>
<input type="password" name="pass">
<input type="submit" value="login">
</form>
<?
// and exit
exit();
}
// end password protection code
?>
:bemused: realy old login script i use to use for a simple site.
just change 'password here' to what ever and that will be the password then just put all the stuff u want protected under it. :eek: