Allora perdona la mia ignoranza .. ma ho proprio... ho creato tre file:
login.php--------------------------------------------
<html>
<head></head>
<body>
<form action="proteggi.php" method="post">
<input type="text" name="username" value="user"/>
<input type="password" name="pwd" />
<input type="submit" name="pwd" />
</form>
</body>
</html>
----------------------------------------------------
verifica.php--------------------------------------------
<?php
session_start();
$user = 'Pluto';
$pass = 'Pippo';
if(!isset($_POST['username']) || !isset($_POST['pwd'])
|| $_POST['username'] != $user || $_POST['pwd'] != $pass)
header('Location: login.php?msg=Utente non validato');
$session['utente'] = $user . '$' . $pass;
header('Location: proteggi.php');
?>
----------------------------------------------------
e infine proteggi.php----------------------------------
<?php
session_start();
if(!isset($_session['utente']) || empty($_session['utente']))
header('Location: ./login.php?msg=Sessione scaduta');
?>
<html>
<head></head>
<body>
<?php echo 'aio'; ?>
</body>
</html>
--------------------------------------------------------
Il problmea è che se anche inserisco correttamente Pippo e Pluto come user e psw non mi fa entrare in proteggi.php (sessione scaduta sulla barra degli indirizzi del broswer)

... ho creato tre file:
Rispondi quotando