[thelist] PHP 500 error

Andrew andrew at humanbehaviour.co.uk
Mon Mar 3 08:10:01 CST 2003


Any one of the PHP guru's know why this produces a 500 error?

Cheers
Andrew

function do_auth($user, $pass) {
		if(!isset($user)) {
			header("WWW-Authenticate: Basic realm=\"".$this->config('authname')."\"");
			header("HTTP/1.0 401 Unauthorized");

			echo "Bad Username/Password.\n";
			exit;
		} else {
			if(!($user == $this->config('user') and $pass == $this->config('pass'))) {
				 Header("WWW-Authenticate: Basic realm=\"".$this->config('authname')."\"");
				 Header("HTTP/1.0 401 Unauthorized");
				 echo "Bad Username/Password.";
				 exit;
			}
		}

		return $this->authed = true;
	}



More information about the thelist mailing list