<?php
$links = array();
$links[] .= "http://www.affiliateprogram1.com/xxxxx";
$links[] .= "http://www.affiliateprogram2.com/xxxxx";
$links[] .= "http://www.affiliateprogram2.com/xxxxx";
$last = count($links) - 1;
$choice = rand(0, $last);
header("location". $links[$choice]);
?>
Anything wrong with this code? Is there a better way to do it?
Thanks!
$links = array();
$links[] .= "http://www.affiliateprogram1.com/xxxxx";
$links[] .= "http://www.affiliateprogram2.com/xxxxx";
$links[] .= "http://www.affiliateprogram2.com/xxxxx";
$last = count($links) - 1;
$choice = rand(0, $last);
header("location". $links[$choice]);
?>
Anything wrong with this code? Is there a better way to do it?
Thanks!