help! Need php rotator site script

jdubinc

Newbie
Joined
Jul 9, 2010
Messages
12
Reaction score
0
I am a noob lol... I want to make my sites rotate so when you go to site A/rotate.php it will guide you to either B, C, or D...

So I Want mulitple rotations... I've tried a few things with little success.

help!
 
if you are familiar with php use array_rand function
See first example here
http://php.net/manual/en/function.array-rand.php

this how it will work ;) not tested but it should you can add as many sites you wants.
Code:
<?php
srand((float) microtime() * 10000000);
$input = array("http://www.firstsite.com", 
				"http://www.secondtsite.com", 
				"http://www.thirdsite.come"
				);
$rand_keys = array_rand($input, 2);
$link = $input[$rand_keys[0]] ;

header("Location: $link");
?>
 
Last edited:
Do you own the sites/pages you want to rotate amongst? If so, you could use Google's Website Optimizer. This will rotate and track conversions/actions.
 
Back
Top