Ciao...
sto cercando in qualche modo un script per le pagine protette e ho scaricato qui (html.it) questo script che però mi da un errore nella pagina login.php:
Parse error: syntax error, unexpected $end in /web/htdocs/www.miosito.it/home/a/login.php on line 42
login.phpPerché da questo errore?Codice PHP:
<? session_start(); ?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
<?
function check($user,$password){
include("utenti.php");
foreach($utenti as $user_ => $password_){
if (($user==$user_) AND ($password==$password_)) {
return true;
}
}
return false;
}
function form_login(){
?>
<form id="login" method="post">
<input type="text" name="utente" size="20" /></td>
<input type="password" name="password" size="20" /></td>
<input name="submit" type="submit" value=" OK " /> </td>
</form>
<? }
if(isset($_POST["utente"])){
if (check($_POST["utente"],$_POST["password"])){
$_SESSION["utente"] = $_POST["utente"];
$_SESSION["password"] = $_POST["password"];
echo'<meta HTTP-EQUIV="refresh" content=1;url="index.php">';
exit;
}else{
form_login();
}
?>
</body>
</html>
Grazie mille!!!