Guys,
My site worked fine until I upgraded PHP
The code below used to work :-
<?php
if ($PHP_AUTH_USER == "" && $PHP_AUTH_PW == ""
&&
ereg("^Basic ", $HTTP_AUTHORIZATION)) {
list($PHP_AUTH_USER, $PHP_AUTH_PW) = explode(":",base64_decode(substr($HTTP_AUTHORIZATION,6)));
}
$authenticated = 0;
if ($PHP_AUTH_USER != "" || $PHP_AUTH_PW != "" {
//put your authentication here (e.g. database lookup)
$authenticated = ($PHP_AUTH_USER == "auk" && $PHP_AUTH_PW = "pass"
}
if(!$authenticated) {
header(" Basic realm=\"if (ereg("Microsoft", $SERVER_SOFTWARE))
header("Status: 401 Unauthorized"
else
header("HTTP/1.0 401 Unauthorized"
echo "Access denied";
exit;
}
?>
But now, under 4.1.2 you are not presented with a login box. If I tell IIS to use integrated ... I get a login box but this includes domain info that I do not want.
Help!!!!!
My site worked fine until I upgraded PHP
The code below used to work :-
<?php
if ($PHP_AUTH_USER == "" && $PHP_AUTH_PW == ""
&&
ereg("^Basic ", $HTTP_AUTHORIZATION)) {
list($PHP_AUTH_USER, $PHP_AUTH_PW) = explode(":",base64_decode(substr($HTTP_AUTHORIZATION,6)));
}
$authenticated = 0;
if ($PHP_AUTH_USER != "" || $PHP_AUTH_PW != "" {
//put your authentication here (e.g. database lookup)
$authenticated = ($PHP_AUTH_USER == "auk" && $PHP_AUTH_PW = "pass"
}
if(!$authenticated) {
header(" Basic realm=\"if (ereg("Microsoft", $SERVER_SOFTWARE))
header("Status: 401 Unauthorized"
else
header("HTTP/1.0 401 Unauthorized"
echo "Access denied";
exit;
}
?>
But now, under 4.1.2 you are not presented with a login box. If I tell IIS to use integrated ... I get a login box but this includes domain info that I do not want.
Help!!!!!