You need to tell us what version of PHP you're running in both environments... this should have been your first step -- detrmining the difference between the two set-ups, basically using php_info().
My guess is that you're running PHP > 4.2 on the local machine, which has a default setting of register_globals OFF in your php.ini file, which contradicts what your "live" server has it set to. The short answer is to turn register_globals ON, the long answer would be: 1. read the release notes for the recent versions 2. check out the millions of threads and messages in this lists' archives, mostly with the subject "register globals" 3. read up on the new predefined variables such as $_POST, $_COOKIE, $_GET, $_SESSION, etc etc, and learn how to modify your scripts to run in this more secure manner: http://www.php.net/manual/en/language.variables.predefined.php Justin French on 07/07/02 6:19 PM, Chris Schoeman ([EMAIL PROTECTED]) wrote: > I am using the folowing script for authorization: > > $username = "test"; > $password = "123"; > > function authenticate() { > Header( "WWW-authenticate: basic realm=\"Protected\""); > Header( "HTTP/1.0 401 Unauthorized"); > echo "Gebruikersnaam en/of wachtwoord is niet goed ingevuld!\n"; > exit; > } > > function CheckPwd($user,$pass) { > global $username,$password; > return ($user != $username || $pass != $password) ? false : true; > } > > if(!isset($PHP_AUTH_USER)) { > authenticate(); > } > elseif(!CheckPwd($PHP_AUTH_USER,$PHP_AUTH_PW)) { > authenticate(); > } > > On my hosting provider this script works fine, om my own computer > where I > run a server it doesn't work. > I run an Internet Information Server on my own computer. > > Anyone has an idea. > > Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php