chce zrobic autoryzacje na stronie !!!
mam problem !!
po wpisaniu przykladu z manuala :
<html>
<head>
</head>
<body>
<?php
function authenticate() {
header( "WWW-Authenticate: Basic realm="Testowy system autoryzacji"");
header( "HTTP/1.0 401 Unauthorized");
echo "Musisz podać poprawny login i hasło by wejść na tę stronęn";
exit;
}
if(!isset($PHP_AUTH_USER) || ($SeenBefore == 1 && !strcmp($OldAuth, $PHP_AUTH_USER)) ) {
authenticate();
}
else {
echo "</p>Witaj: $PHP_AUTH_USER<br>";
echo "Poprzenio: $OldAuth";
echo "<form action="$PHP_SELF" METHOD=POST>n";
echo "<input type="hidden" name="SeenBefore" value="1">n";
echo "<input type="hidden" name="OldAuth" value="$PHP_AUTH_USER">n";
echo "<input type="submit" value="Re Authenticate">n";
echo "</form></p>n";
}
?>
</body>
</html>
wystepuje taki blad w :
Warning: Cannot add header information - headers already sent by (output started at c:apachehtdocsuwierzytelnianie.php:5)
in c:apachehtdocsuwierzytelnianie.php on line 7
Warning: Cannot add header information - headers already sent by (output started at c:apachehtdocsuwierzytelnianie.php:5)
in c:apachehtdocsuwierzytelnianie.php on line 8