in reply to Re: Re: Re: Re: Content-type: html and images ?
in thread Content-type: html and images ?

( ... a web tutorial on CGI used print STDOUT)

Which web tutorial was this? In my experience a tutorial that makes a mistake like that will often make many other (more serious) mistakes and should probably be avoided.

I still don't get how my image path is fed to the show_pic.cgi

I think we all pretty much assumed that the image path would be hard-coded in the CGI program.

Must I access the database in show_pic.cgi rather than in the script that generates the html ?

Now I'm a little confused. What do you need to access the database for?

I was suggesting a program like this:

#!/usr/bin/perl use strict; use warnings; use CGI ':standard'; if (param('action') eq 'showImage') { # code to open the image file and print contents } else { # code to print the HTML page # this includes an image tag that links back to this # program with the parameter "action=showImage" }

If that's not what you're thinking of then we've been talking at cross-purposes.

--
<http://www.dave.org.uk>

"The first rule of Perl club is you do not talk about Perl club."
-- Chip Salzenberg