Http autentification

software development

#1

I try to use this script :

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

Hello, {$_SERVER[‘PHP_AUTH_USER’]}.

”;
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.


#2

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