Http autentification

software development


I try to use this script :

if (!isset($_SERVER[‘PHP_AUTH_USER’])) {
header(‘WWW-Authenticate: Basic realm=“My Realm”’);
echo ‘Texte utilisé si le visiteur utilise le bouton d’annulation’;
} else {
echo “


echo “

Your password is {$_SERVER[‘PHP_AUTH_PW’]}.


but $_SERVER[‘PHP_AUTH_USER’] is never set, does someone have an idea???

It’s should work, but not with my hosting.

I tried to use htaccess, but it block dynamic download for my flash application, even if I don’t forbid linking for file.


http authentication hooks don’t work when php is being run as a cgi.

to use that script, just open your control panel and uncheck Run PHP as a cgi

Hope that helps