Rotate code ?

Discussion in 'HTML & Website Design' started by Rivmedia, Jul 16, 2009.

  1. #1
    hey guys just a quick one , is there any code that can rotate 2 or 3 banners ? so after every refresh of the page the banner changes ?

    My script has messed up and i need a temp solution so keep my clients happy
     
    Rivmedia, Jul 16, 2009 IP
  2. HivelocityDD

    HivelocityDD Peon

    Messages:
    179
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You can do it simply creating an array of banners and selecting it randomly each time the page is loaded.

    If you need any help with it please PM me.

    I can help you with it
     
    HivelocityDD, Jul 16, 2009 IP
  3. Kerosene

    Kerosene Alpha & Omega™ Staff

    Messages:
    11,366
    Likes Received:
    575
    Best Answers:
    4
    Trophy Points:
    385
    #3
    You can do it with PHP - something like this:
    <?
    $myrand = rand(1,3);
    if ($myrand==1){ echo 'YOUR BANNER1 CODE'; }
    if ($myrand==2){ echo 'YOUR BANNER2 CODE'; }
    if ($myrand==3){ echo 'YOUR BANNER3 CODE'; }
    ?>
    PHP:
     
    Kerosene, Jul 16, 2009 IP