Forum Moderators: coopster
echo " <script language = 'javascript' type='text/javascript'>
<!--
var mins = ".$timelimit.";
var secs = 60;
function changeClock() {
if (!(mins == 0 && secs == 0)) {
if (secs == 0) {
mins -= 1;
secs = 60;
}
secs -= 1;
document.getElementById('clock').innerHTML = mins + 'mins ' + secs + 'seconds left to next refresh';
}
}
setInterval('changeClock()', 1000);
function reloadwindow () {
window.location = 'RegularEmailScript.php?Send=yes&start=".$start."&origtotal=".$origtotal."';
}
setTimeout('reloadwindow()', ".$timeout.");
// -->
</script>
";
I have also tried just writing th javascript in and using var mins = <?php echo ($timelimit);?>; but this doesn't seem to work either.
Any ideas?