Kod
/* PHP_AUTH_USER */
<?php
require("config.php");
$LOGIN = $login;
$PASSWORD = $pass;
function error ($error_message) {
echo "<body bgcolor=#3A5980><div align=center><b><font size=1px color=#94bedc face=tahoma>".$error_message."</font></b></div><br>";
exit;
}
if ( (!isset($_SERVER['PHP_AUTH_USER'])) || ! (($_SERVER['PHP_AUTH_USER'] == $LOGIN) && ( $_SERVER['PHP_AUTH_PW'] == "$PASSWORD" )) ) {
header("WWW-Authenticate: Basic entrer="Form2txt admin"");
header("HTTP/1.0 401 Unauthorized");
error("Musisz podac login i hasło!");
}
?>
[...]
<?php
require("config.php");
$LOGIN = $login;
$PASSWORD = $pass;
function error ($error_message) {
echo "<body bgcolor=#3A5980><div align=center><b><font size=1px color=#94bedc face=tahoma>".$error_message."</font></b></div><br>";
exit;
}
if ( (!isset($_SERVER['PHP_AUTH_USER'])) || ! (($_SERVER['PHP_AUTH_USER'] == $LOGIN) && ( $_SERVER['PHP_AUTH_PW'] == "$PASSWORD" )) ) {
header("WWW-Authenticate: Basic entrer="Form2txt admin"");
header("HTTP/1.0 401 Unauthorized");
error("Musisz podac login i hasło!");
}
?>
[...]
kiedy wywoluje ten skrypt, wywala mi taki komunikat:
Kod
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, xxx@xxxxxx.xx and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
--------------------------------------------------------------------------------
Apache/1.3.14 Server at localhost Port 80
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, xxx@xxxxxx.xx and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
--------------------------------------------------------------------------------
Apache/1.3.14 Server at localhost Port 80
"...misconfiguration..." - szukalem w konfiguracj (tzn. php.ini) i nie widze tam zadnego bledu... czy ktos wie jak ten problem "zabic";) A moze wystarczy jakis patch albo cos...
ps.
Cytat
manual napisal:
Autoryzacja HTTP nie działa jeśli używasz serwera Microsoft IIS i php w wersji CGI.
Autoryzacja HTTP nie działa jeśli używasz serwera Microsoft IIS i php w wersji CGI.
qrka bo zwatpilem... chodzi o to, ze PHP_AUTH_USER na Microsoft IIS + php w wersji CGI nie dziala, czy nie dziala na Microsoft IIS i nie dziala na php w wersji CGI?? :/