Hi,
My script that im trying to protect is pretty much one file, but acts as about 4/5 pages... so im using the <?=$PHP_SELF?>?page=whatever way of structuring it..
however, when you first open any page, you can log in ok, and if you log in badly it tells you.. when its fine it opens the protected page...
yet when i go to a link to a different page (same file) i get the login page again....
my asumption is that the session isnt actually registering...
can anyone help please?
this is my accesscontrol file....
<?
include "db.php" ;
if(!isset($uid)) {
// login page....
}
$password_encrypted = md5($pass) ;
$pwd = "$password_encrypted" ;
session_register("uid");
session_register("pwd");
$result = mysql_query("SELECT * FROM db WHERE login_name = '$uid' AND login_password = '$pwd' AND email_check = 'ok'");
if (!$result) {
error("A database error occurred while checking your ".
"login details.\nIf this error persists, please ".
"contact me.");
}
if (mysql_num_rows($result) == 0) {
session_unregister("uid");
session_unregister("pwd");
//failed page...
?>