Hi, I have written a php/javascript code to check a database for a variable, which is 15 seconds to display something, or 30 seconds. Then it sends the variable to javascript to run the countdown. It works in firefox, but when I try it in IE7, the countdown starts at 10 seconds no matter what.
<script language="JavaScript" type="text/javascript">
<?php
$sqlh = "SELECT * FROM tb_ads WHERE id='$adse'";
$resulth = mysql_query($sqlh);
$myrowh = mysql_fetch_array($resulth);
$plan = $myrowh["visittime"];
if($plan=="15"){
$time = 16;
}else{
$time = 31;
}
echo "var x = ".$time;
?>
var y = 1
function startClock(){
if(x!=='Done'){
x = x-y
document.frm.clock.value = x
setTimeout("startClock()", 1000)
}
if(x==0){
x='Done';
document.frm.clock.value = x;
success.location.href="success.php?ad="+document.frm.id.value+"&
verify="+document.frm.verify.value;
}}
</script>