Thread: php help
View Single Post
Old 08-28-2007, 02:19 PM  
calmlikeabomb
Confirmed User
 
calmlikeabomb's Avatar
 
Join Date: May 2004
Location: SW Palm Bay, Florida
Posts: 1,323
PHP Code:
<?php

ob_start
();

list(
$num$url) = array(mt_rand(01), array('http://www.yahoo.com/''http://www.google.com/'));

header("Location: $url[$num]"); ob_flush(); exit();

?>
Use the url array to store the address you want to redirect to. The first parameter of mt_rand() must be zero, because the first index of an array is always 0 then, 1, 2, 3, etc. You'll want the second parameter to be total number items in the array. Don't forget the first item in the array is indexed as 0.
__________________
subarus.
calmlikeabomb is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote