in reply to Re: Re: CGI-SQL-HTML-Display "no image"
in thread CGI-SQL-HTML-Display "no image"

You need to present the img tag with src as an url. That will take transforming the filesystem path to something like 'http://host.nil/' . substr $fn, length( $ENV{DOCUMENT_ROOT})

After Compline,
Zaxo

Replies are listed 'Best First'.
Re: Re: Re: Re: CGI-SQL-HTML-Display "no image"
by WhiteBird (Hermit) on May 26, 2003 at 06:23 UTC
    I'd feel remiss if I didn't update this node with a completed answer. (Thanks to Zaxo for the confirmation about the filesystem path.) I wasn't sure of the filesystem path on the hosting server, so I used a snippet of super-searched code from The Environment variable for URL... to find the path, which I then used in my code.
    my $path = "/web_dir/web_sub_dir/"; my $filepath = "D:\\my_ip_address\\web_dir\\web_sub_dir\\"; #Calls to database, data-fetching snipped #Determine if the image file exists $photo=$Data{ID}.'.jpg'; $fn = $filepath.$photo; if (-e $fn) { $image = "$path$photo"; } else { $image = $path."DefaultPhoto.gif"; } ##Snipped HTML display, etc....
    This works the way I need it to and displays the image if it is available or the default "no photo available" image if not. Thanks, Monks, for the assistance.
    WB