Try this:
PHP Code:
<?php
session_start();
$mypage = 'index.php';
if (!isset($_SESSION['refresher'])) {
$_SESSION['refresher'] = 10;
}
elseif ($_SESSION['refresher'] <= 0) {
$_SESSION['refresher'] = 10;
header("location:$mypage");
}
else {
$_SESSION['refresher']--;
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="refresh" content="10">
<title>Refresher</title>
</head>
<body>
<p><?php echo $_SESSION['refresher']+1; ?> times until redirection.</p>
</body>
</html>
Bookmarks