1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

link url rotator needed

Discussion in 'PHP & Perl' started by le5oy, Oct 5, 2008.

  1. le5oy

    le5oy Newbie

    Joined:
    Sep 21, 2008
    Messages:
    16
    Likes Received:
    5
    i need a url rotator that when you click the link it goes to one of the url's in the url rotator. I don't mean a homepage rotator but one that when you click a link on the homepage it goes to one of the links which i add to the rotator. can anyone help?
     
    Last edited: Oct 5, 2008
  2. liamtohd

    liamtohd Registered Member

    Joined:
    Mar 24, 2008
    Messages:
    75
    Likes Received:
    40
  3. bosshog

    bosshog Newbie

    Joined:
    Mar 15, 2008
    Messages:
    43
    Likes Received:
    3
    Occupation:
    web programmerr
    Location:
    texas
    Heres what I posted there..

    Code:
    <?PHP
    
    srand((float) microtime() * 10000000);
    
    $url_list = array("http://site.com",
                      "http://site2.com",
                      "http://site3.com",
                      "http://site4.com",
                      "http://site5.com");
    
    header('Location: '.$url_list[rand(0,count($url_list))]);
    
    ?>
    
     
  4. BlackBeret

    BlackBeret Regular Member

    Joined:
    Jul 12, 2008
    Messages:
    257
    Likes Received:
    61
    Location:
    Transexual, Transylvania
    So, to use this code you would save a page like links.php and put just this code on it and make the link from the homepage link to the links.php page?