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

okay, Im still being stupid :(
Have got rid of the print STDOUT's at least ! (I thought this was
needed, a web tutorial on CGI used print STDOUT)

I still don't get how my image path is fed to the show_pic.cgi
Must I access the database in show_pic.cgi rather than in the script that generates the html ?

sorry to be so thick ! Its a monday....
thanks for all your help
  • Comment on Re: Re: Re: Re: Content-type: html and images ?

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Content-type: html and images ?
by davorg (Chancellor) on Feb 10, 2003 at 16:16 UTC
    ( ... 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