Click to See Complete Forum and Search --> : Perl scripting


Triple__J
06-22-2001, 06:56 PM
I need to make several banners come up randimly and not to sure where to begin.I have the banner.cgi and the web page but not to sure where to go from there. I'm new to perl so i'm confused???

Grizzly
06-22-2001, 07:50 PM
You can use the SSI command:

<!--#exec cgi="cgi-bin/banner.cgi"-->
Which will include into your web page whatever that banner.cgi returns. (You must use the .shtml file extension for the web server to recognize that command)

Or, I have a pretty quick and easy JavaScript one you could use

Triple__J
06-22-2001, 07:55 PM
yah I'd love to use the javascript one.
that would be cool.
thanks for the help

Grizzly
06-23-2001, 02:24 AM
Here ya go:

<script language="JavaScript">

var how_many_ads = 3;
var now = new Date()
var sec = now.getSeconds()
var ad = sec % how_many_ads;
ad +=1;
if (ad==1) {
alt="Banner1";
banner="images/banner1.jpg";
width="468";
height="64";
}
if (ad==2) {
alt="Banner2";
banner="images/banner2.jpg";
width="468";
height="64";
}
if (ad==3) {
alt="Banner3";
banner="images/banner3.jpg";
width="468";
height="64";
}

document.write('<center>');
document.write('<img src=\"' + banner + '\" width=')
document.write(width + ' height=' + height + ' ');
document.write('alt=\"' + alt + '\" border=0><br>');
document.write('</center>');

</script>


Give that a shot, I think it's pretty self explanatory on what needs to be altered in order to place in your own images into the mix. Good luck with it.

namgor
06-23-2001, 12:39 PM
Ya Javascript can do the trick, you can find tons of free scripts at http://javascript.internet.com

------------------
DHAHL3seasons GP:73 G:121 A:55 Pts:176 GWG:12 +/-:184
UWSWA1season GP:9 G:12 A:8 Pts:20 GWG:3 +/-:-3

uwcdc.com (http://www.uwcdc.com) or namgor.com (http://www.namgor.com)