pagina protetta con cookie e login multiutente?
ciao a tutti ho creato una pagina protetta nel mio sito dove qst č il file in php:
Codice PHP:
<html>
<head>
<title>Login</title>
</head>
<body>
<?php
$username = "usernameprova";
$password = "passwordprova";
$user = $_POST["user"];
$pass = $_POST["pass"];
if ($user == $username && $pass == $password)
{
setcookie("login", "OK", time() + 1800);
{ header("Location:paginaprotetta.php");}
}
else
{
print "<h1>Errore</h1><br /><h2>Accesso negato!</h2>";
}
?>
</body>
</html
allora qst file funziona perņ funziona con un solo utente qnd con un solo username e password, come faccio ad aggiungere altri utenti per fare un login multiutente?