Re: Why it doesnt work
| From: | M. Sokolewicz | Date: | Fri, 10 Dec 2004 13:14:27 +0000 |
| Subject: | Re: Why it doesnt work | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-203923@lists.php.net to get a copy of this message | ||
register_globals? :)
Aalee wrote:
Hi ive tried this script and it doesnt seem to work for me. I have typed exactly the same username and password in the script..it keeps on asking for the username and password..pls help...cud this be due to a setting in the php or apache server...am using php 4.3 and apache 1.3.33...the code is <?php if (!isset($PHP_AUTH_USER)) { header('WWW-Authenticate: Basic realm="My Private Stuff"'); header('HTTP/1.0 401 Unauthorized'); echo 'Authorization Required.'; exit; } else if (isset($PHP_AUTH_USER)) { if (($PHP_AUTH_USER != "admin") || ($PHP_AUTH_PW != "abc123")) { header('WWW-Authenticate: Basic realm="My Private Stuff"'); header('HTTP/1.0 401 Unauthorized'); echo 'Authorization Required.'; exit; } else { echo " <P>You're authorized!</p> "; } } ?> cheers...