Want to use an Ad Rotator

Discussion in 'PHP' started by dutch1, May 22, 2009.

  1. #1
    Can someone write some code for an "ad rotator" in PHP? I'm just no good at PHP.

    Thanks
     
    dutch1, May 22, 2009 IP
  2. tonicc

    tonicc Well-Known Member

    Messages:
    198
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    101
    #2
    You can use Openx to manage the ads in your site.
     
    tonicc, May 22, 2009 IP
  3. WeedGrinch

    WeedGrinch Active Member

    Messages:
    1,236
    Likes Received:
    73
    Best Answers:
    0
    Trophy Points:
    90
    #3
    Here ya go

    Rotates 3 adds.

    
    <?php
    $number = rand(1, 3);
    if ($number == 1)
    {
    echo "CODE FOR ADD ONE";
    }
    
    elseif ($number == 2)
    {
    echo "CODE FOR ADD TWO";
    }
    
    else
    {
    echo "CODE FOR ADD THREE";
    }
    
    ?>
    
    Code (markup):
    Demo: http://gamingjunkiez.com/dutch1.php
     
    WeedGrinch, May 22, 2009 IP
  4. dutch1

    dutch1 Peon

    Messages:
    357
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thanks for the information and code. It's much appreciated.

    Regards,
    Gerald
     
    dutch1, May 22, 2009 IP