MrCreeky Posted September 30, 2008 Share Posted September 30, 2008 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 More sharing options...
MrCreeky Posted September 30, 2008 Author Share Posted September 30, 2008 Fixed, leaving off the <?php upset the the windows server. Link to comment https://forums.phpfreaks.com/topic/126411-solved-php-countdown-help/#findComment-653669 Share on other sites More sharing options...
PFMaBiSmAd Posted September 30, 2008 Share Posted September 30, 2008 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. Link to comment https://forums.phpfreaks.com/topic/126411-solved-php-countdown-help/#findComment-653732 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.