In your .cfg file, define your banner files and their associated URLs into arrays. Be sure to use the whole URL, including the http:// part.
$banner[0] = "prettybanner.jpg";
$urlclick[0] = "
http://www.someplacenice.com";
$banner[1] = "anotherbanner.jpg";
$urlclick[1] = "
http://www.anotherplace.com";
and so on
Notice that each banner and its URL have the same place in their own array. Be sure to use [0] for the first element of your array.
In html.pl, wherever you want your banner to print out, add the following:
$index = rand @banner;
print qq|<a href="$urlclick[$index]"><img src="
http://path.to.graphics.directory/$banner[$index]"></a>|;
If your banners are all the same size, it would be good form to include height and width attributes to your img src tag.
I've never done this, but this seems like the logical way to do it. You can have weighted randomness,too. If you wanted one banner to show up twice as often as the rest, just define that graphic and URL twice.
If you want them to rotate, then you have a completely different ball game.
(edited to fix the error in the link.)
JPD
----------------------------------------------------
JPDeni's DBMan-ual How to
ask questions the smart way.