Non riuscirò mai a capire come mai....sarò che ora sono troppo rintronato, ma non mi era mai successo....come mai non funziona????
INDEX
Codice PHP:
<?php
if(!isset($_SESSION['password'])){
echo'
<div id="content">
<div id="pw">
<form name="campoPw" action="accesso.php" method="post" >
<input type="password" title="password" size="12" name="password" id="pw" />
<input type="submit" id="bottInvio" value="Accedi">
</form>
</div>
</div>';
}
else{
echo'
<div id="content">
<div id="logOut">
<form id="formLogOut" name="LogOut" action="index.php" method="post">
<input type="submit" title="Log Out" name="logOut" value="Log-Out" />
</form>
</div>';
if($_SESSION['password']=="**********")
echo' [url="gestioneClienti.php"]Gestione Clienti[/url]';
else echo'<span></span>
</div>';
}
?>
ACCESSO
Codice PHP:
<?php
$pw = $_POST['password'];
$time = 3600;
$numCli = 5;
if(isset($_POST['password']) && $_POST['password'] != "" ){
if($pw=="**********"){ $_SESSION['password']=$pw; header("Location: index.php"); }
else{
for($i=1; $i<$numCli+1; $i++){
$open = fopen("cli".$i."/ciao.txt","r");
if(fread($open,10) == $pw){
$_SESSION['password']=$pw;
$_SESSION['cliente']="cli".$i;
fclose($open);
header("Location: cliente.php");
return;
}//IF
else header("Location: error.php?errore=La password \"".$pw."\" è errata!");
}//FOR
}//ELSE
}//IF
else{ header("Location: error.php"); }//ELSE
?>
In locale mi funziona...in rete niente di niente :berto: