Hey guys am new to php actually..I have an input form and when the user types something in that input form it displays.what i want to do is, after a minute i want the session to be expired and redirect to another website..I know this can be done easily with javascript..But i would like to do it with php sessions..So the code i have written is
<?php
if ( isset($_POST['firstname'])) {
echo $_POST['firstname'];
session_start();
$_SESSION['logintime'] = time();
if(time() - $_SESSION['logintime'] > 60) {
header('Location: http://www.google.com/');
} else {
echo 'blah';
}
}
?>
When i run the code i gets the inputname and blah
(which means the second if statement not working).
Hope you guys could help me out..Any help would be appreciated ..Thanks