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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

$PHP_AUTH_USER doesn't work

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
0
0
This is my code:

if(!isset($PHP_AUTH_USER)) {
Header(" Basic realm=\"foro\"");
Header("http/1.0 401 Unauthorized");
echo "User hits CANCEL";
exit;
}
else{
echo &quot;<P>&quot;;
echo $PHP_AUTH_USER;
echo &quot;</P><P>&quot;;
echo $PHP_AUTH_PW;
echo &quot;<P>&quot;;
}

When the page is loaded, a login/password dialog box appear, but I type some text in both fields and it is always showed &quot;User hits CANCEL&quot;.

I don't understand the meaning of &quot;Basic realm&quot;

It may be that &quot;\foro\&quot; is a bad parameter ???
 
OK, Now I know what was wrong:

This was an ugly kind of Apache's Nigthmare cuz http authentication doesn't work if htacces is enabled :((

I hope that my experience will be useful 4 any1.

 
Also, note that certain web servers don't support the $PHP_* built-in variables. For instance, IIS under NT would use $REMOTE_USER.


===========================================
Small footprint P2P web server for Windows,
File-sharing, PHP, wireless apps & more
===========================================
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top