Frage zu Countdownscript

spikaner

Quereinsteiger @ php
Habe hier Folgendes script meine Frage wie bekomme ich das script dazu wenn die Zeit abgelaufen ist das es mir dann einen link anzeigt?
HTML:
<?php
$timestamp = time() + 500;
$testausgabe = date("F, j Y H:i:s",$timestamp);
echo $testausgabe;
?>
<script type='text/javascript'>
var end = new Date('<?php echo $testausgabe ?>'); // hier läuft irgendwas schief bzw wie bokomme ich die Variable hinein
function toSt2(n) {
  s = '';
  if (n < 10) s += '0';
  return (s + n).toString();
}
function toSt3(n) {
  s = '';
  if (n < 10) s += '00';
  else if (n < 100) s += '0';
  return (s + n).toString();
}
function countdown() {
  d = new Date();
  count = Math.floor(end.getTime() - d.getTime());
  if(count > 0) {
    miliseconds = toSt3(count%1000); count = Math.floor(count/1000);
    seconds = toSt2(count%60); count = Math.floor(count/60);
    minutes = toSt2(count%60); count = Math.floor(count/60);
    hours = toSt2(count%24); count = Math.floor(count/24);
    days = count;
    document.getElementById('c1').innerHTML = days + ' Tage';
    document.getElementById('c2').innerHTML = hours + ':' + minutes + ':' + seconds
    setTimeout('countdown()', 50);
  }
}
</script>

<body onload='countdown();'>

<div align=center>
 <SPAN id=c1 style="FONT: bold 14px arial; COLOR: red;"></SPAN><br>
 <SPAN id=c2 style="FONT: bold 14px arial; COLOR: red;">;</SPAN><br>
</div>

mfg Spikaner
 
Code:
if(count > 0) {
    miliseconds = toSt3(count%1000); count = Math.floor(count/1000);
    seconds = toSt2(count%60); count = Math.floor(count/60);
    minutes = toSt2(count%60); count = Math.floor(count/60);
    hours = toSt2(count%24); count = Math.floor(count/24);
    days = count;
    document.getElementById('c1').innerHTML = days + ' Tage';
    document.getElementById('c2').innerHTML = hours + ':' + minutes + ':' + seconds
    setTimeout('countdown()', 50);
  }

else
{
   alert("LINK");
}

oder
Code:
if(count > 0) {
    miliseconds = toSt3(count%1000); count = Math.floor(count/1000);
    seconds = toSt2(count%60); count = Math.floor(count/60);
    minutes = toSt2(count%60); count = Math.floor(count/60);
    hours = toSt2(count%24); count = Math.floor(count/24);
    days = count;
    document.getElementById('c1').innerHTML = days + ' Tage';
    document.getElementById('c2').innerHTML = hours + ':' + minutes + ':' + seconds
    setTimeout('countdown()', 50);
  }
else
{
    document.getElementById('linkbox').innerHTML = "LINK";
}
würde ich mal sagen...
 
Zurück