i'm trying to protect a web page: Member_page.php whith a login and a password using sessions, but if we just log off and press the precedent buttom i can have access to Member_page.php, so it's just like i'm having no protection, here are my files:
index1.htm:
<form action="verif.php" method="post">
Votre login : <input type="text" name="login">
<br />
Votre mot de passé : <input type="text" name="pwd"><br />
<input type="submit" value="Connexion">
</form>
verif.php
$login_sql ="toto";
$password_sql ="toto";
if (($_POST['login']=="toto") && ($_POST['pwd']=="toto")){
session_start();
session_register("login");
session_register("pwd");
header('location:Member_page.php'); }
else { echo "Erreur d'identification, veuillez entrez un login et un mot de passe valide !"; // Sinon l'identification n'est pas réussite
include("index1.htm");
}
?>
Member_page.php
session_start();
if ((isset($_SESSION["login"])) && (isset($_SESSION["pwd"]))) {
echo "Bienvenue sur l'espace membre !";
header('location: main_menu.html');
echo "<a href=logout.php> Vous déconnectez ?!</a><br>"; }
else{
echo "Erreur : vous devez vous identifiez pour avoir accès à cette espace !";
include("index1.htm");
}
So how can i deal with this, thanks in advance