kgp Posted March 14, 2011 Share Posted March 14, 2011 Hi I did not se this in any posts and it seems to be a good script. It was supposed to be in somthing I bought but instaed they just put it in a video. Problem is I am getting an error in the if statement, or at least that is what it is telling me. Anyone know what is wrong with it? Appreciate your help in advance Thanks <?php $siteA ="http://www.yoursite.com/A.html"; $siteB ="http://www.yoursite.com/B.html"; $switchtime = "2011-03-14 06:44:00"; $k = strtotime($switchtime); $t = (int)date('U') /* DEBUG */ //echo date("y-m-d h:i:s T",$k); //echo "<br/>".date("Y-m-d h:i:s T",$t); /* */ if($t<$k) header('location: '.$siteA); else header('location: '.$siteB); ?> Quote Link to comment https://forums.phpfreaks.com/topic/230577-php-webite-switching-script/ Share on other sites More sharing options...
QuickOldCar Posted March 14, 2011 Share Posted March 14, 2011 <?php $siteA ="http://www.yoursite.com/A.html"; $siteB ="http://www.yoursite.com/B.html"; $switchtime = "2011-03-14 06:44:00"; $k = strtotime($switchtime); $t = (int)date('U') /* DEBUG */ //echo date("y-m-d h:i:s T",$k); //echo "<br/>".date("Y-m-d h:i:s T",$t); /* */ if($t<$k){ header("location: $siteA"); }else { header("location: $siteB"); } ?> Quote Link to comment https://forums.phpfreaks.com/topic/230577-php-webite-switching-script/#findComment-1187276 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.