Forum Moderators: coopster
if($_POST['password'] == 'correct_password') {
header("Location: http://www.example.com/redirected_page.html");
exit();
} else {
echo 'You did not type in the correct password';
}
Oh course, you post a form to this page with something like the following:
<input type="text" name="password" />
If you are gonig to want to incorporate multiple passwords, you are going to have to take a silghtly different approach.
Just a quick note here. The redirected page is NOT secure, and anyone can see it if they type in the uri into the browser. To make it secure you can set a session variables and make sure it exists on the redirected page, or you can echo out the information to the browser right after the password check, instead of using the header*() redirect.
Good luck
you could also do http authentication through php: [php.net...]
:)