Allora ti crei config.php dove inserisci:
<?
$password='pippo'; # valore password
?>
---dove pippo è la password scelta---
poi crei la pagina dove metterai la richiesta password es riservato.html
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#000000">
<center>
<table width="401" height="260" border="0">
<tr>
<td width="432" height="254">
<div align="center">
<form method="post" action="privato.php">
</p>
</p>
<input type="password" name="password">
</p>
<input type="submit" name="Submit" value="CONFERMA">
</p>
</form>
</div></td>
</tr>
</table>
</center>
</body>
</html>
----Dove privato.php sta per la pagina che andrai ad aprire e dove inserirai il seguente codice:
<?
include 'config.php';
$pass=$_POST['password'];
if ($password==$pass) {
include 'index.html';
}
else {
echo "
<center>ACCESSO NEGATO";
echo "</font><font face=$textfont size=2>";
echo "
Password: $pass
";
echo "non è la giusta password!
";
echo "effettua in modo corretto il <a href=\"riservato.html\">login</a>[b]";
}
?>
DOVE index.html è la pagina normalmente creata che tu vuoi aprire.
Prova ora