That's not how HTTP works.
Your HTML and the image it references are two separate HTTP requests. Your script tries to answer both requests in one response. This approach will not work.
You need to wait for the image request and then send the image data. If you want/need to carry information from the page request to the image request, either use a cookie or pass the information in the image URL as a CGI parameter.
In reply to Re: CGI and image
by Corion
in thread CGI and image
by urizackhem
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |