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:
    136
    Likes Received:
    181
    Occupation:
    Job? Whats a job?
    Location:
    America
    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:
    150
    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!