Problem con l'accesso alle pagine protette

piasomma

Nuovo Utente
15 Dic 2008
1
0
0
Questo è il codice del mio programmino:

<HTML>

<HEAD>
<TITLE>login e pass </TITLE>
</HEAD>

<BODY>
<?php

include ("C:\Programmi\Apache Software Foundation\Apache2.2\htdocs\verifica.php");
$_SERVER['PHP_AUTH_USER']='piasomma';
$_SERVER['PHP_AUTH_PW']='camila';
$user=$_SERVER['PHP_AUTH_USER'];
$password=$_SERVER['PHP_AUTH_PW'];



if (!isset($user) || verifica($user,$password)==false){
header('WWW-Authenticate:Basic realm="Trop Secret"');
header('HTTP/1.1 401 Unathorized');
echo 'autenticazione fallita';
exit;
}
else {
echo "Autenticazione riuscita";

}
?>
</BODY>
</HTML>

Il browser mi visualizza queste informazioni:

Warning: Cannot modify header information - headers already sent by (output started at C:\Programmi\Apache Software Foundation\Apache2.2\htdocs\login_password.php:8) in C:\Programmi\Apache Software Foundation\Apache2.2\htdocs\login_password.php on line 19

Warning: Cannot modify header information - headers already sent by (output started at C:\Programmi\Apache Software Foundation\Apache2.2\htdocs\login_password.php:8) in C:\Programmi\Apache Software Foundation\Apache2.2\htdocs\login_password.php on line 20
autenticazione fallita

Che posso fare?

Scusate se chiedo troppo ma alla fine che vogliono dire queste due frasi ? :
header('WWW-Authenticate:Basic realm="Trop Secret"');
header('HTTP/1.1 401 Unathorized');

Sto studiando a casa da sola ! non ne capisco molto!
 

Discussioni simili