I'm trying to implement "HTTP User Authentication" for some files but not directories.
Below is the following script I am using to test "HTTP User Authentication":
if ($PHP_AUTH_USER != "user" || $PHP_AUTH_PW != "pass") { // visitor has not yet given details, or their // name and password combination are not correct
header('WWW-Authenticate: Basic realm="Realm-Name"');
header("HTTP/1.0 401 Unauthorized");
echo "<h1>Go Away!</h1>"; echo "You are not authorized to view this resource."; } else { // visitor has provided correct details echo "<h1>Here it is!</h1>"; echo "<p>I bet you are glad you you can see this secret page."; }
The works on localhost but it doesn't work when uploaded to my Yahoo domain.
Please keep in mind that I am talking about Yahoo's Small Business Webhosting and not Geocities Webhosting.
Yahoo does provide Authentication but only for directories and not individual files.
just wondering if there's another way. Thanks in advance. -gohaku
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php