Auth. with PHP3 on macOS X server?
| From: | Magnus Hammar | Date: | Wed, 12 Jul 2000 16:08:56 +0000 |
| Subject: | Auth. with PHP3 on macOS X server? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-6171@lists.php.net to get a copy of this message | ||
Hello!
I have installed MacOS X Server with Apache, MySQL and php3.
I wanted to use www-authentication with php3 so I wrote this script:
----------------------------------------------
<?php
if($PHP_AUTH_USER != ""){
echo "
<html>
<head><title>Yes!</title></head>
<body bgcolor=\"white\">
<pre>
Login: $PHP_AUTH_USER
Passw: $PHP_AUTH_PW
Uthtyp: $PHP_AUTH_TYPE
</pre>
</body>
</htmL>
";
}else{
Header("WWW-Authenticate: Basic realm=\"My Realm\"");
Header("HTTP/1.0 401 Unauthorized");
echo "
<html>
<head><title>401</title></head>
<body bgcolor=\"white\">
Make sure you typed in the login and password right...<br>
<pre>
Login: $PHP_AUTH_USER
Passw: $PHP_AUTH_PW
Uthtyp: $PHP_AUTH_TYPE
</pre>
</body>
</htmL>
";
}
?>
------------------------------------------
I made it just as a test, but this doesn't work.
If the script is correct you should get access if you just typed in
anything in the login field.
But it doesn't work on MacOS X server with Apache.
Can someone tell me what the problem is? =)
Is it Apache, Php3 och MacOS X server that is making me crazy?
I can't even get the information from $PHP_AUTH_USER or $PHP_AUTH_PW, but
the realm was shown right and the login window was right.
So, try to crack that if you can! =)
Thanks
/Magnus Hammar
--------------