Perl scripting

Sharky Forums


Results 1 to 5 of 5

Thread: Perl scripting

  1. #1
    Expensive Sushi
    Join Date
    May 2001
    Location
    Surrey, BC, Canada
    Posts
    35

    Unhappy Perl scripting

    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???

  2. #2
    Ursus Arctos Moderatis Grizzly's Avatar
    Join Date
    Sep 2000
    Location
    Providence, RI USA
    Posts
    3,077

    Post

    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

  3. #3
    Expensive Sushi
    Join Date
    May 2001
    Location
    Surrey, BC, Canada
    Posts
    35

    Post

    yah I'd love to use the javascript one.
    that would be cool.
    thanks for the help

  4. #4
    Ursus Arctos Moderatis Grizzly's Avatar
    Join Date
    Sep 2000
    Location
    Providence, RI USA
    Posts
    3,077

    Post

    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.

  5. #5
    Hammerhead Shark
    Join Date
    Oct 2000
    Location
    Toronto, Canada
    Posts
    1,493

    Post

    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 or namgor.com
    DHAHL3seasons GP:73 G:121 A:55 Pts:176 GWG:12 +/-:184
    UWSWA6seasons GP:41 G:53 A:46 Pts:99 GWG:5 +/-:-25
    MCBHL3seasons GP:14 G:20 A:8 Pts:28 GWG:4 +/-:19

    uwcdc.com or monkis.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •