Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

iis5 / PHP authentication

Status
Not open for further replies.

mptrew

MIS
Sep 7, 2001
42
GB
Guys,

My site worked fine until I upgraded PHP :)

The code below used to work :-

<?php
if ($PHP_AUTH_USER == &quot;&quot; && $PHP_AUTH_PW == &quot;&quot;
&&
ereg(&quot;^Basic &quot;, $HTTP_AUTHORIZATION)) {
list($PHP_AUTH_USER, $PHP_AUTH_PW) = explode(&quot;:&quot;,base64_decode(substr($HTTP_AUTHORIZATION,6)));
}
$authenticated = 0;
if ($PHP_AUTH_USER != &quot;&quot; || $PHP_AUTH_PW != &quot;&quot;) {
//put your authentication here (e.g. database lookup)
$authenticated = ($PHP_AUTH_USER == &quot;auk&quot; && $PHP_AUTH_PW = &quot;pass&quot;);
}
if(!$authenticated) {
header(&quot; Basic realm=\&quot;if (ereg(&quot;Microsoft&quot;, $SERVER_SOFTWARE))
header(&quot;Status: 401 Unauthorized&quot;);
else
header(&quot;HTTP/1.0 401 Unauthorized&quot;);
echo &quot;Access denied&quot;;
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!!!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top