Authorization

From: Date: Sun, 07 Jul 2002 08:19:49 +0000
Subject: Authorization
Groups: php.general 
Request: Send a blank email to php-general+get-105939@lists.php.net to get a copy of this message
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

« previous php.general (#105939) next »