I created a script that uses simple HTTP authentication. I just copied the sample code from PHP documentation and modified it slightly. It works very well on my server, and on most clients' websitesm but about 10% of the people complain that it doesn't work. I checked on one of their servers and it simply turns out that $_SERVER["PHP_AUTH_*"] variables are never set, reagrdless on what was entered in the browser. Do you know what can cause this?
Could it have something to do with the version of PHP? Superglobals such as $_GET , $_POST, and $_SERVER, etc. have only been available since PHP 4.1.0.
Did you try something like: if (@phpversion() < '4.1.0') { $_FILE = $HTTP_POST_FILES; $_GET = $HTTP_GET_VARS; $_POST = $HTTP_POST_VARS; // etc... } PHP:
Not, it's not on old versions of PHP, its't the opposite - the problem apperas on newest versions! I had seen this on various webhosts, most of them have no problem but on sume it's just plain not working, and I did verify that PHP version is above 4.1.0. Could it be a problem with server configuration?
yes have u tried it on a different server? download easyphp its free and it will let u run a server locally.. then u can test it and see if it has errors there too