in reply to Mixing HTML and GIF

Lhoward - major problem with either me or the code!
How does that code in #1 load the image? Your code doesn't open a file to read out the image!
Not angry, just how would I go about loading an existing image?

Replies are listed 'Best First'.
(chromatic) RE: Re: Mixing HTML and GIF
by chromatic (Archbishop) on Jul 16, 2000 at 00:30 UTC
    Off the top of my head, more suited to show you the general means by which I'd tackle the program than the exact syntax:
    use strict; use CGI; my $q = CGI->new(); { local *IMAGE; open(IMAGE, $q->param('image')) || die "Can't open: $!"; binmode(STDOUT); print while <IMAGE>; close IMAGE; }
RE: Re: Mixing HTML and GIF
by Aighearach (Initiate) on Jul 16, 2000 at 03:09 UTC
    His #1 has two code segments. The first one is from your main cgi, which calls the second segment. That segment prints out two things: the header (image/gif) and the image itself.
    Paris Sinclair    |    4a75737420416e6f74686572
    pariss@efn.org    |    205065726c204861636b6572
    I wear my Geek Code on my finger.
    
RE: Re: Mixing HTML and GIF
by BigJoe (Curate) on Jul 15, 2000 at 23:31 UTC
    if the banners are on a different site just put that in the path on the example I gave. Otherwise you can use JavaScript to pick a random pic but you have to load every pic to the page. But then it would be a JavaScript thing and not a PERL question.

    --BigJoe