Here's the code (thank you very much to BlueWalrus):
In the page after the login, put this code there before anything else:
PHP Code:
<?php
if ($_SERVER['HTTP_REFERER'] == "http://kapleenmusic.webfreehosting.net/thisisatestyouknow.php" || $_SERVER['HTTP_REFERER'] =="yoursite.com/login.php")
\\Change that link to the page of the login. {
if ($_GET['secured'] == 24) {
?>
And put this after everything else on that page:
PHP Code:
<?php
} else {
echo "Unverified"; }
} else {
echo "Sorry, but your login failed.";
}
?>
Put this code before anything else on the Login page:
PHP Code:
<?php
if ( isset($_POST['username']) && isset($_POST['password'])) {
if ($_POST['username']=="foo" && $_POST['password']=="password") {
header("Location: thepagetologinto.php?secured=24");
} else {
$fail = "Login Failed";
}
}
?>
in [icode]header("Location: thepagetologinto.php?secured=24"); change thepageyouloginto.php to, well, the page you login to. And to edit the user names and passwords, edit ($_POST['username']=="userhere" && $_POST['password']=="passwordhere") {
You can add multiple like this:
PHP Code:
if ($_POST['username']=="foo" && $_POST['password']=="password") {
if ($_POST['username']=="foo" && $_POST['password']=="password") {
Have fun and once again thanks BlueWalrus!
Bookmarks