Looking for a spinner that can spin between 10 different links

Discussion in 'PHP' started by skullcane, Aug 18, 2011.

  1. #1
    I'm looking for a spinner that...


    When visitors come to my website, I want them to be randomly redirected from a choice of 10 different links.


    For example.


    Visitor #1 goes to mysite.com/page.php and lands on google.com
    Visitor #2 goes to mysite.com/page.php and lands on twitter.com
    etc.... etc...


    Thanks.
     
    skullcane, Aug 18, 2011 IP
  2. iBank ™

    iBank ™ Peon

    Messages:
    63
    Likes Received:
    4
    Best Answers:
    1
    Trophy Points:
    0
    #2
    <?php
    
    $links = array("domain-1.com", "domain-2.com", "domain-3.com", "domain-4");
    
    $randomLink = rand(0, sizeof($links) - 1);
    
    header("Location: " . $links[$randomLink]);
    
    ?>
    PHP:
    Not tested, but should be working as requested.
     
    iBank ™, Aug 18, 2011 IP