|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2001-06-15 10:01 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 19:00:02 2025 UTC |
Hi, trying to do simple HTTP authentication (just to get it working, as the original mySQL connected version did not work -- same "symptoms") with this php code: <?php if(!isset($PHP_AUTH_USER)) { Header("WWW-Authenticate: Basic realm=\"My Realm\""); Header("Status: 401 Unauthorized"); echo "Text to send if user hits Cancel button\n"; exit; } else { echo "Hello $PHP_AUTH_USER.<P>"; echo "You entered $PHP_AUTH_PW as your password.<P>"; } ?> this is in a standalone file, login.php it brings up the login prompt, but seems unable to get past that -- entering a login does nothing. The popup shows 3 times, then it redirects to a page displaying the results of the "echo "Text to send if user hits Cancel Button\n";" line. Not sure if i'm doing something wrong (doubt it, i copied this code from php.net after trying to write my own (which got the same results)) or if this is a bug....it may well be a bug with apache, but perhaps y'all know something about this.... Software setup info: SERVER_SOFTWARE => Apache/1.3.20 (Win32) SERVER_PROTOCOL => HTTP/1.1 HTTP_USER_AGENT => Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0) PHP Version: 4.0.5