Jump to content

PHP webite switching script


kgp

Recommended Posts

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);

 

?>

Link to comment
https://forums.phpfreaks.com/topic/230577-php-webite-switching-script/
Share on other sites

<?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");
   }
   ?>

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.