Quote:
Originally Posted by klinton
bump for working solution....
|
With what you had, change it up a touch and try this:
<?php
$urls[] = "";
$urls[] = "http://www.redirect1.com";
$urls[] = "http://www.redirect2.com";
$urls[] = "";
srand ((double) microtime( )*1000000);
$random = rand(0,count($urls)-1);
if(!empty($urls[$random]))
{
header("location:" . $urls[$random]);
exit;
}
?>
That way it should redirect into one of the other urls or drop into the page like normal. I would think that would work. Don't know what the SEs would think of it.
Edited in: I just dropped that into the top of one of my wife's blogs index.php and it worked fine. It does not give you the control by % but it does do the redirect. You could just do a little file read and keep track by counter of how many times you went to each url pretty easy to get that control.
.