You are here: PHP_AUTH_* doesn't work on Apache? « PHP Programming Language « IT news, forums, messages
PHP_AUTH_* doesn't work on Apache?

Posted by yawnmoth on 11/05/07 23:33

I was trying to test the following PHP script and am having some
difficulty:

<?php
if (empty($_SERVER['PHP_AUTH_USER']) ||
empty($_SERVER['PHP_AUTH_PW']))
{
header('WWW-Authenticate: Basic realm="Admin Control Panel"');
header('HTTP/1.0 401 Unauthorized');
exit;
}

echo 'PHP_AUTH_USER:
'.htmlspecialchars($_SERVER['PHP_AUTH_USER']).'<br />';
echo 'PHP_AUTH_PW: '.htmlspecialchars($_SERVER['PHP_AUTH_PW']);
?>

When I try it on Abyss web server what happens is that I enter "test"
as my username / password and then it echoes them back to me. On
Apache, it just keeps prompting me for the password. It's as though
PHP_AUTH_* is never being set. Any ideas as to why this is and what
I'd need to do to fix it?

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация