You haven't really given enough data to be sure, but here's my guess at what is happening.
Your CGI program and the image are both in the /cgi-bin directory on your web server. Your web server is almost certainly configured to treat all requests for content within cgi-bin as a request for executable content. Therefore here's what happens:
- Browser requests /cgi-bin/your-program
- Your program returns your HTML, but that includes a reference to logo.jpg. This is a relative URL so the browser requests it from the same place as the current page
- Therefore the browser requests /cgi-bin/logo.jpg
- As this request is for a resource in cgi-bin the web server tries to execute the file (logo.jpg) and return the output to the browser (in exactly the same way as it does for any CGI request)
- As logo.jpg is not an executable file, the operating system returns an error when the web server tries to execute it
- The web server therefore returns a 500 error to the browser, but as this isn't the main request for the page the browser just puts a "broken image" placeholder on the page.
If this is the case, there are a few lessons you can learn:
- Only executable files go in the cgi-bin directory. Static content goes elsewhere in the directory tree
- Checking the web server access log would have shown you the requests that were being made
- Checking the error log would have shown you the error that the web server got when trying to execute the image file.
--
<
http://dave.org.uk>
"The first rule of Perl club is you do not talk about
Perl club."
-- Chip Salzenberg