Ecco il codice della index, dove inserisco username e password per accedere.
$userlog=strip_tags($_POST['user']);
$passwordlog=strip_tags($_POST['pass']);
$cercadati=mysql_query("select * from clienti where username='$userlog' and password='$passwordlog' and stato='1' ");
$trovate=mysql_num_rows($cercadati);
while ($mostra=mysql_fetch_array($cercadati)) {
$nome=$mostra['nome'];
$cognome=$mostra['cognome'];
$idx=$mostra['id'];
}
if ($trovate==1) {
$_SESSION['userutente']=$userlog;
$_SESSION['passutente']=$passwordlog;
}
if (isset($_SESSION['passutente']))
{
codice della pagina......
}

Rispondi quotando