Jump to content

[SOLVED] php countdown help


MrCreeky

Recommended Posts

I have modified this countdown code and everything works fine on locally but when I publish the site to my web server the code stops showing the result. My local computer is a Mac running OSX 10.5 and the web server is windows 2003. Do you think this is where the problem could lay or is it something else.

 

<?php 
  $day   = ($row_rs1_events['ddate']);     // Day of the countdown
  $month = ($row_rs1_events['mdate']);      // Month of the countdown
  $year  = ($row_rs1_events['ydate']);   // Year of the countdown
  $hour  = 20;     // Hour of the day (east coast time)
  $event = ($row_rs1_events['name']); //event

  $calculation = ((mktime ($hour,0,0,$month,$day,$year) - time(void))/3600);
  $hours = (int)$calculation;
  $days  = (int)($hours/24);
?>

There are only  <? echo $days ?> days until <? echo $event ?> starts.

 

As you can see, for some of the data such as $day I'm asking the mySQL database for the information.

Link to comment
https://forums.phpfreaks.com/topic/126411-solved-php-countdown-help/
Share on other sites

Using short open tags will result in code that is non-portable between servers, because you won't always be on a server where you are able to turn the short_open_tag setting on. Always using full open tags will prevent this problem entirely (full open tags will always work.) And you should be consistent when programming. Don't mix full and short open tags in your code.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.