ginocapelli has asked for the wisdom of the Perl Monks concerning the following question:
I am trying to display a random banner in various html generated pages using ssi. Is there anyway to get this subroutine to display an image in my html generated pages using ssi, so that I don't have to using two separate banner rotators?! I am a newbie :)sub banner_rotator { $banner = ""; $link_image = "1"; # 1 = YES; 0 = NO srand(time ^ $$); $num = rand(@images); # Pick a Random Number # Print Out Random Filename and Base Directory if ($link_image eq '1' && $urls[$num] ne "") { $banner .= "<a href=\"$urls[$num]\" target=\"_blank\">"; } $banner .= "<img src=\"$basedir$images[$num]\""; if ($border ne "") { $banner .= " border=$border"; } if ($align ne "") { $banner .= " align=$align"; } if ($alt[$num] ne "") { $banner .= " alt=\"$alt[$num]\""; } $banner .= ">"; if ($link_image eq '1' && $urls[$num] ne "") { $banner .= "</a>"; } $banner .= "\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Calling a subroutine and dispalying an image using ssi
by tachyon (Chancellor) on Jul 07, 2001 at 23:26 UTC | |
by Anonymous Monk on Jul 07, 2001 at 23:43 UTC | |
by John M. Dlugosz (Monsignor) on Jul 08, 2001 at 00:28 UTC | |
|
Re: Calling a subroutine and dispalying an image using ssi
by tachyon (Chancellor) on Jul 08, 2001 at 04:03 UTC |