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

baner rotation, here ya go

Discussion in 'PHP & Perl' started by shade, Jan 18, 2009.

  1. shade

    shade Junior Member

    Joined:
    Jan 1, 2009
    Messages:
    137
    Likes Received:
    179
    Occupation:
    Job? Whats a job?
    Location:
    America
    Home Page:
    I've seen people make extremely long banner rotation codes and quite frankly there annoying. So people please don't freken use if and else statements for your code it's stupid.

    You just need something like:

    <?php
    $ran = rand(1, 5);
    $link = link.$ran;
    $img = images\yourbannerhere.$ran;
    echo "<html><head></head><body><a href=\"$link\"><img src=\"$img\" boder=\"0\"></a></body></html>";
    ?>
     
  2. steveJD

    steveJD Junior Member

    Joined:
    Nov 29, 2008
    Messages:
    146
    Likes Received:
    142
    spot on - i was wondering about scripting something like this myself but to also log impressions so that i can swap between CPC, CPA, CPI but this is a start! cheers!