A to skrypt który udało mi się wykombinować:
CODE
<?php
session_start();
if(isset($_POST['czas'])) $_SESSION['czas']=$_POST['czas'];
function javascript($odlicz)
{
echo '<script type="text/javascript">
var sec='.$odlicz.';
function time() {
if(sec==0) {
location.href="index.php";
} else {
sec--;
document.getElementById("tm").innerHTML=(sec < 10) ? ("0" + sec) : sec;
setTimeout("time();", 1000);
}
}
</script>';
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Language" content="pl">
<title>tytuł</title>
<?php javascript($_SESSION['czas']); ?>
</head>
<body onload="time()">
<p><?php echo $_SESSION['raz']; ?></p>
<form method="POST" action="index.php">
<p>Wstaw czas odliczania: <input type="text" name="czas" size="20"><input type="submit" value="Prześlij" name="przeslij"><input type="reset" value="Resetuj" name="B2"></p>
</form>
<p> </p>
<p><span id="tm"><?php echo $_SESSION['czas']; ?></span></p>
<form method="POST" action="index.php">
<p><input type="submit" value="Dalej" name="dalej"></p>
</form>
</body>
</html>