basics w/o code:
you need to use [man]session[/man]s:
1) set up a place for username in session
2) have some login page set the username in the session
3) each page that authenticates has to look for a username in the session, if it is there they must have gone through the login page ok, if username does not exist or it is empy, they must not have logged in and they can be booted
4) look at the username, if it matches the person who should be able to look at the directory, pass, otherwise boot them.
code won't do any good without knowing if you have
1) register_globals on or off
2) session_autostart in php.ini
if you have
1) register_globals off
2) session_autotstart on
the code should looks something like this
### login.php
if ( isset($_POST['username']) && isset($_POST['password']) ) {
if ( loginOk($_POST['username'],$_POST['password']) ) {
$_SESSION['username'] = $_POST['username'];
} else {
unset($_SESSION['username'])
showTheLoginForm();
}
}
### authenticated page
if ( empty($_SESSION['username']) || $_SESSION['username'] != 'ednark' ) {
bootInTheArse();
}