jcadima
7/19/2017 - 1:23 PM

PHP redirect at a specific time

PHP redirect at a specific time


<?php
//March 21, 2014 at 18:20 GMT
date_default_timezone_set('GMT');
$target = strtotime("March 21, 2014, 18:20");
$date = strtotime(date("F j, Y, g:i a"));
//IMPORTANT:  This must be at the top of your page1.html before anything is sent to browser!
if($date>=$target){
	header("location: page2.html");
	exit;
}