Page 1 of 1

Random redirect to url

Posted: Mon Sep 25, 2006 11:42 am
by jeff.mikolai
I need a little help finishing this script, or even any better ways of doing it. I simply want to randomly send a user to a url. Here is what I have so far:

<?
$random_url = array("http://www.url1.com",
"http://www.url2.com",
"http://www.url3.com",
"http://www.url4.com",
"http://www.url5.com");

srand(time());
$random = (rand()%5);

print("URL: $random_url[$random]");
?>

How do I perform the redirect or should I use an iframe and if so how.

Thank you,
Jeff Mikolai

Re: Random redirect to url

Posted: Mon Sep 25, 2006 12:30 pm
by ambivalent
jeff.mikolai wrote:
How do I perform the redirect ....
Use header()

Posted: Mon Sep 25, 2006 12:35 pm
by jeff.mikolai
Thanks! Got it working!