Scusate mi sapreste dire come posso far ricordare al browser la mia password dopo l'invio di dati allo stesso form?
Codice PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Amministrazione SiteMap</title>
</head>
<body>
<form action="" method="post">
<input type="password" name="login" value="" />
<input type="submit" value="Login" />
</form>
</body>
</html>
<?
$login = $_POST['login'];
$file = "sitemap.xml";
if($login == "mia_password"){
if ( isset($_POST['contenuto']) && ( $f = fopen("$file","w+") ) ) {
fwrite($f, $_POST['contenuto']);
fclose($f);
}
$c = file_get_contents("$file");
echo "<form name=\"form\" method=\"POST\" action=\"".$_SERVER['php_self']."\">";
echo "<textarea name=\"contenuto\" style=\"width: 285px; height: 198px\">".$c."</textarea>";
echo "<br /><br /><input type=\"submit\" value=\"Invia\">";
echo "</form>";
}else{
echo "<script type=\"text/javascript\">alert('Login Errato')</script";
echo "<center>Login Errato</center>";
};
?>
Cioè voglio che mi ricordi!