It would be easier to use sessions. In your php pages AT THE TOP, write this:
session_start();
Once the person is logged in, then set the session loggedin or something.
$_SESSION['loggedin']; = "true"
On the protected pages do something like this:
session_start();
if($_SESSION['loggedin'] != "true")
{
echo "You must log in to access this page.";
include "loginform.htm";
exit();
}
Hope that helps,
-Blake