Quick Question Using CGI / Perl

Hi, I just had 1 question, for this here, the images folder is in the cgi directory with the cgi file but the images don’t display… any ideals? thanks.


sub create_acknowledgment_page {
print <<END_HTML;
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 <head>
   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
   <title>Comment has been Submitted</title>
   <style type="text/css">
     #header { float: left; }
   </style>
 </head>
 <body>
   <img src="images/apache-hdr-logo.jpg">
   <img src="images/apache-hdr-waterfall.gif">
 </body>
</html>
END_HTML
}

If you’re using Internet Explorer to view the page it might be the JPEG files are stored using the CMKY color profile. IE doesn’t display those images.
If you’re not using IE, or, if the same images do show up on other pages then I haven’t a clue.

You can determine if it’s a path (or mod-rewrite?) or image problem by changing the relative path to an absolute path.

yea its weird, i might have to get rid of that one function because it doesn’t want to display any images… in the other functions the path is perfect.

that cgi script that I have, has several functions and its all based pretty much on validation. if the form fields are empty send a error page else process through. the other function that i have is identical code but the only difference is that it says error please go back. however for the other function if i use that path it works, the images do display, but this other identical function doesn’t. idk if im missing something big here or not.

Possibly the relative url is still not good: the url you use should be in relation to where Perl is putting/making this HTML file.

For instance, if the HTML file is in public_html and the images folder is next to (not inside) public_html, then the HTML file needs to call the images as
…/images/imagename.png
where …/ goes up a level (out of public_html) before going into images.

Disregard all of the above if you’re letting Apache do any mod_rewrite…

If you put the url for one of the images in you browser address bar does the image display.

If it doesn’t then that is the problem, the fact that the html page is being generated by a perl script is irrelevant.

yea, the images do display. idk what my exact problem could be