Wherever you're generating your random URLs. If you do more processing before actually doing the redirect, put it before the header() line. You'll need to modify the highlighted parts:
For the highlighted "1", just put the number of pages that you will, minus one. For the array, just put a list of pages to redirect to. The URL of the random page is stored in $random_page, and you can redirect using the Location: header, like that in the code I posted.Code:$rn = rand(0,1); // first argument is minimum (inclusive), then maximum (inclusive). $arr = array("http://www.google.com/","http://www.yahoo.com/"); $random_page = $arr[$rn];




Reply With Quote