Jump to content

[SOLVED] What's wrong with my coding?


tqla

Recommended Posts

Hello. Can someone tell me what is wrong with my coding. I don't get an error but the defaultmovie file always appears regardless of dates. I'm pretty sure my mistake is in the strtotime line but I don't know for sure. Thanks.

 

<?php
$startyear = "2008";
$startmonth = "12";
$startday = "08";
$finishyear = "2008";
$finishmonth = "12";
$finishday = "20";
$movie = "choppers.php";
$defaultmovie = "amnesia.php";
$start = strtotime($startyear - $startmonth - $startday);
$finish = strtotime($finishyear - $finishmonth - $finishday); 
if(time() >= $start && time() < $finish){ 
include($movie); 
} else {
include($defaultmovie); 
}
?>

Link to comment
https://forums.phpfreaks.com/topic/136291-solved-whats-wrong-with-my-coding/
Share on other sites

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.