hello,
I am beginner in php.....I got a problem in following script
<?php
session_start();
$logout = $_POST['logout'];
if(isset($logout)){
unset($_SESSION['uname']);
unset($_SESSION['password']);
session_destroy();
header('location:registrationform.php');
}
?>
according to the above script when i click on logout button my page go to my registrationform page but when i click back button in my browser it goes back to above script means to the logout page....what is the reason for that......i also want to know how to setup my session from login till logout.
thanks in advance.
php session problem
Moderator: General Moderators
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: php session problem
You want ot check if the actual $_POST variable is set:
Code: Select all
if(isset($_POST['logout'])){(#10850)