I am building a simple user recognition script, but I am having some trouble with the following parameters:

I am able to redirect the user following the username and password validation to the page I desire.

What I need to do right now is find a way to protect the pages that the user is being redirected too. I don't want to use cookie recognition so I'm trying to include a condition in the pages I wish to protect.

Something like:

<?php include("easylogicsprocessing.php");
require($login == true);
?>

in the top of the pages I want to protect.

Consequently, I would have to do something like...



//The file that the form will process: (easylogicsprocessing.php)

<?php
require("configure.php");

if ($username == $a & $password == $a1) :
header("Location:user1page.php");
$login == true;
elseif ($username == $b & $password == $b1):
header("Location:user2page.php");
$login == true;
else :
header("Location:error.php");
$login == false;
endif;
?>



//The Configure.php page
<?
$a = "user1";
$a1 = "password1";
$b = "user2";
$b1 = "password2";
?>

//The HTML Form

<form action="members/easylogicsprocessing.php" METHOD="post">
<input name="username" type="text" style="width:112;height:18">
<input name="password" type="password">
<input name="Submit" type=image value="Submit" src="images/go1.jpg" width="46" height="25">
</form>

Sadly, the conditions always return false, and this solution simply sn't working.

What am I missing guys?

Be kind, please!