Any DECENT, simple banner/image rotation scripts?

Discussion in 'Programming' started by ian_batten, Jan 9, 2007.

  1. #1
    Hello all,
    I guess this is a bit of a simply question, but I am looking for a banner rotation script.
    I have looked on hotscripts, but not really found anything at a glance. Basically I am looking for a rotation script that displays images of any size, which can have link/can't have links on each image.
    Anyone got any good SIMPLE links or scripts, do let me know!
    Thanks in advance.
     
    ian_batten, Jan 9, 2007 IP
  2. ccoonen

    ccoonen Well-Known Member

    Messages:
    1,606
    Likes Received:
    71
    Best Answers:
    0
    Trophy Points:
    160
    #2
    Which language do you want this banner rotator in? Essentially, its all about querering the same data but in a random fashion.

    I know google analytics even allows you to do A-B banner testing so if you build it from the ground up, you could incorporate realtime stats :)
     
    ccoonen, Jan 12, 2007 IP
  3. InnovativeWebNola

    InnovativeWebNola Peon

    Messages:
    23
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Well, if your server supports PHP, and you are able to change the file names of the banner images to numbers, you could implement something like this:

    
    
    <?
    
    // Example using random display of one image out of five.  Each image is named "1.gif, 2.gif, etc."
    
    $image_number = rand(1,5); // Picks a random number between 1 and 5.
    
    ?>
    
    <a href="#"><img src="<? echo $image_number; ?>.gif" alt="Banner Image" /></a> 
    
    
    Code (markup):
    There is a way to do this without modifying the image file names, but you would need to know the names and locations of them in advance. Hope this helps. :)
     
    InnovativeWebNola, Jan 15, 2007 IP
    ian_batten likes this.
  4. ian_batten

    ian_batten Well-Known Member

    Messages:
    1,991
    Likes Received:
    106
    Best Answers:
    0
    Trophy Points:
    185
    #4
    Sorry for the late reply...thanks a lot for the script there Innovativewebnola!
     
    ian_batten, Jan 21, 2007 IP