Re: [PHP-LANG] PHP4 & AUTH procedure
[email protected] ("Alexander Gr?f")
| Newsgroups | php.lang |
|---|---|
| Message-ID | <[email protected]> |
It has something to do with register_globals. Try to turn it on in your
php.ini. I tried it myself and found out that this piece of code works:
<?php
if(!isset($HTTP_SERVER_VARS['PHP_AUTH_USER']))
{
Header("WWW-authenticate: Basic realm=\"Acceso restringido\"");
Header("HTTP/1.1 401 Unauthorized");
echo "To access you need a pair (name,password), SORRY!!";
exit;
}
else
{
echo "ALL OK";
exit;
}
?>
When you don't have access to the configuration of php (for example hosted
by a web provider) you can use this.
Hope this was helpfull
--
[email protected]
+49 9721 188848
+49 171 370 97 15