By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,313 Members | 1,240 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,313 IT Pros & Developers. It's quick & easy.

Header and Authentification

P: n/a

I want use the header authentification (HTTP/PHP module), and i've a
big problem for to get the varaibles 'PHP_AUTH-*".

This is my source code :
function authentificate() {
header('WWW-Authenticate: Basic realm="My Realm"');
header('HTTP/1.0 401 Unauthorized');
echo 'Texte utilisť si le visiteur utilise le bouton

$sql = new MyDB();

$userauth =

if ($userauth == ($_SERVER['PHP_AUTH_USER'])) ##
Don't work
(or if ("maxx" == ($_SERVER['PHP_AUTH_USER'])) ##
echo "c bon";
print_r ($_SERVER);
The window popup authentification don't open and i am going directly on
my page. When i replace "$userauth" by "maxx" for example, the window
popup authentification open with no problem and i can login myself.

Jul 17 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.