I need a php code which i upload on my domain. what it will do is redirect visitors to different different urls based on certain time period like say for the first 10 mins it should redirect to google.com later on for the next 10 mins to gmail or something else whatever which i specify and so on. Is there is any way to do that coz right now i have to do it manually which is really hectic. All i got so far is this but its not working! `
$tym = date("h:i");
echo $tym;
if ($tym >= "06:10" && $tym < "06:20"){
$urls = array(
array('url' => 'http://website1.com'),
);}
if ($tym >= "06:20" && $tym < "06:30"){
$urls = array(
array('url' => 'http://website2.com'),
);}
//and so on
$probs = array();
foreach ($urls as $i => $url) {
$probs = array_merge($probs, array_fill(1, $i));
}
$rand = array_rand($probs);
var_dump($rand);
var_dump($urls[$probs[$rand]]['url']);
header('Location: '.$urls[$probs[$rand]]['url']);`
Need some help please! Thanks in advance.