Note that there are some explanatory texts on larger screens.

plurals
  1. POPHP/Javascript countdown script
    primarykey
    data
    text
    <p>Note <strong><em>*</em></strong> I want some one to fix it and tell me how they did it not tips on how to do it or coments about php nd java mixed in it <strong><em>*</em></strong></p> <p>I have a countdown script that is working, but when it hits the target date the timer keeps on going to a negative time. I want it to stop on that target date and just display a finishing message. It's live on my site. I just need help editing the countdown script.</p> <p>I want to keep the same layout. I need some help adding the finishing message and stopping it from going into the negative date, or just make it not display the 0days, 0 hours, 0mins, 0sec until the site's officially released. When that finally happens, I want it to display a message.</p> <p>countdown script</p> <pre><code>&lt;?php date_default_timezone_set('EST'); ?&gt; &lt;?php // Define your target date here $targetYear = 2011; $targetMonth = 9; $targetDay = 1; $targetHour = 20; $targetMinute= 00; $targetSecond= 00; // End target date definition // Define date format $dateFormat = "Y-m-d H:i:s"; $targetDate = mktime($targetHour,$targetMinute,$targetSecond,$targetMonth,$targetDay,$targetYear); $actualDate = time(); $secondsDiff = $targetDate - $actualDate; $remainingDay = floor($secondsDiff/60/60/24); $remainingHour = floor(($secondsDiff-($remainingDay*60*60*24))/60/60); $remainingMinutes = floor(($secondsDiff-($remainingDay*60*60*24)-($remainingHour*60*60))/60); $remainingSeconds = floor(($secondsDiff-($remainingDay*60*60*24)-($remainingHour*60*60))-($remainingMinutes*60)); $targetDateDisplay = date($dateFormat,$targetDate); $actualDateDisplay = date($dateFormat,$actualDate); ?&gt; &lt;script type="text/javascript"&gt; var days = &lt;?php echo $remainingDay; ?&gt; var hours = &lt;?php echo $remainingHour; ?&gt; var minutes = &lt;?php echo $remainingMinutes; ?&gt; var seconds = &lt;?php echo $remainingSeconds; ?&gt; &lt;/script&gt; &lt;body onLoad="setCountDown();"&gt; &lt;center&gt;&lt;?php echo "$remainingDay days, $remainingHour hours, $remainingMinutes minutes and $remainingSeconds seconds";?&gt; untill official release&lt;/center&gt; </code></pre> <p>how its added on the site</p> <pre><code>&lt;script type="text/javascript"&gt; $(function() { /* Union War */ $("#Countdown2").load("http://imperialism.zxq.net/includes/process/uwcountdown.php"); setInterval(function(){ $("#Countdown2").load("http://imperialism.zxq.net/includes/process/uwcountdown.php"); }, 1000); }); &lt;/script&gt; &lt;div id="uwCD" class="uwCD"&gt; &lt;div id="Countdown2"&gt;&lt;/div&gt; &lt;/div&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload