Trying to get redirect once the time is greater than a certain time. <?php $current_time = date(DATE_RFC822); $set_Time1 = 'Thu, 11 Jun 09 12:49:50 -0500'; $set_Time2 = 'Thu, 11 Jun 09 01:49:50 -0500'; if ($current_time >= $set_Time1) { $link = "http://www.gmail.com"; } elseif ($current_time >= $set_Time2) { $link = "http://www.yahoo.com"; } else { $link = "http://www.google.com" } header( "HTTP/1.1 301 Moved Permanently" ); //use 301 for permenant redirect header( "Location: $link" ); //Change Link Here exit(); ?> PHP:
change first 3 lines to something like this $current_time = strtotime(date(DATE_RFC822)); $set_Time1 = strtotime('Thu, 11 Jun 09 12:49:50 -0500'); $set_Time2 = strtotime('Thu, 11 Jun 09 01:49:50 -0500');