I just installed a simple script - all has gone well except when I try to log into the admin area it won't let me the user name and password are the same as I had entered into the config file any idea what could be wrong or what file i should be looking at to correct the problem...thanks here is the php of accesscontrol.php <?php if (!isset($PHP_AUTH_USER)) { header('WWW-Authenticate: Basic realm="'.$sitename.' Admin"'); header('HTTP/1.0 401 Unauthorized'); echo 'Authorization Required.'; exit; } else if (isset($PHP_AUTH_USER)) { if (($PHP_AUTH_USER != $adlogin) || ($PHP_AUTH_PW != $adpassword)) { header('WWW-Authenticate: Basic realm="'.$sitename.' Admin"'); header('HTTP/1.0 401 Unauthorized'); echo 'Authorization Required.'; exit; }else{ session_register("aid"); session_register("apass"); } } ?>
Replace: $PHP_AUTH_USER PHP: With $_SERVER['PHP_AUTH_USER'] PHP: And $PHP_AUTH_PW PHP: With $_SERVER['PHP_AUTH_PW'] PHP: session_register() is deprecated too. Oh well...
Thanks Nico_swd I made the changes but it still doesn't work below is what I did - hope i didn't mess it up again <?php if (!isset($_SERVER['PHP_AUTH_USER'])) { header('WWW-Authenticate: Basic realm="'.$sitename.' Admin"'); header('HTTP/1.0 401 Unauthorized'); echo 'Authorization Required.'; exit; } else if (isset($_SERVER['PHP_AUTH_USER'])) { if (($_SERVER['PHP_AUTH_USER'] != $adlogin) || ($_SERVER['PHP_AUTH_PW'] != $adpassword)) { header('WWW-Authenticate: Basic realm="'.$sitename.' Admin"'); header('HTTP/1.0 401 Unauthorized'); echo 'Authorization Required.'; exit; }else{ session_register("aid"); session_register("apass"); } } ?>