Salve ragazzi!
Ho un problema,
ho scaricato da freephp.html.it
un file contenente del codice da mettere nella pagina che vuoi proteggere con password.
Questo è il codice
codice:
<?php
//
// Copyright 2001 Xavier Media Group
// http://www.xaviermedia.com/php/
//
// If you need help or have suggestions, please visit
// http://www.xaviermedia.com/forum/index.php or
// http://www.xaviermedia.com/php/password.phtml
//
if(!isset($PHP_AUTH_USER))
{
Header("WWW-Authenticate: Basic realm=\"Xavier Protection\"");
Header("HTTP/1.0 401 Unauthorized");
echo "Text to send if user hits Cancel button\n";
exit;
}
else
{
$user_passwords = array (
// user1 is the login name and password1
// is that users password. Add as many
// lines as you like.
"user1" => "password1",
"user2" => "password2",
"user3" => "password3",
"user4" => "password4"
);
if (($PHP_AUTH_USER == "") || ($PHP_AUTH_PW == ""))
{
Header("HTTP/1.0 401 Unauthorized");
echo "Sorry, could find your password!";
exit;
}
else if (strcmp($user_passwords[$PHP_AUTH_USER],$PHP_AUTH_PW) == 0)
{
// This is the page that should be password protected.
echo "This is the password protected page.";
exit;
}
else
{
Header("HTTP/1.0 401 Unauthorized");
echo "Sorry, could find your password!";
exit;
}
}
?>
Lui mi riconosce,ma il fatto è che lui anche se ti ha riconosciuto blocca tutto il codice che viene dopo di lui!
Io non so nulla di PHP quindi mi potreste dire gentilmente cosa devo modificare il codice.
Ciao e grazie in anticipo per le risposte