How about something like the following:
On page one, create a logon page in html/php with 2 fields for the username and password. Submit that page to a php page which will check that the submitted username and password exists in the users table and if it does, set a session variable to "logged on".
The code would look something like this:
Page 1
Standard HTML page with 2 text fields called username and password.
Page 2(the login-check page)
$check_for_user_query = "SELECT username FROM Table WHERE username='" . $_POST['username'] . "' AND password='" . $_POST['password'] . "' LIMIT 1";
$check_for_user_result = mysql_query($check_for_user_query) OR die(mysql_error());
if(mysql_num_rows($check_for_user_result) == 1)
{
$_SESSION['login'] = 'yes';
}
Now use a meta refresh with a time of 0 to log the user straight in if they are found in the user table.
At the top of each page you want to check use something like this:
session_start();
if (@$_SESSION['login'] != 'yes')
{
echo "You have not logged on";
exit();
}
That looks right but you might have to play a bit to make it play properly with what you have.
Good Luck.
🙂