Have a link to a page with a form.
Make that form have 2 fields, username and password.
make the action of the form the page which you wish to secure.
then on the secured page...
if ($_POST['password'] == 'foo' && $_POST['username'] == 'bah') {
echo "Secret message";
} else {
echo "Incorrect username or password. Try again sucker!! Click here";
}
That does 1 page.
If you want to do multiple, as suggested above do this but for sessions. so
session_start();
$_SESSION['username_check'] = 'username';
$_SESSION['password_check'] = 'password';
on the pages necessary, then a form to set them.
$_SESSION['username'] = $_POST['username'];
$_SESSION[password'] = $_POST['password'];
then
if ($_SESSION['username_check'] == $_SESSION['username'] && $_SESSION['password_check'] == $_SESSION[password'])
{
echo 'blah';
}
else
{
echo 'You flail!';
}
example
http://www.poochmedia.com/client_login_demo/