[Solved] images on CGI or HTML files


Impossible to answer because you haven’t given us anywhere near enough information. But your code does give one potential clue.

use CGI qw/:standard/;
use DBI;

print "Content-type:text/html\n\n";
print first();
print myform();
print second();

sub myform {
  return <<B;
<form action='' method='post'>
  <img src="https://stackoverflow.com/questions/26614013/images/img0001.gif" id="Shape1" align="top" alt="" title="" border="0" 
       width="1344" height="126">
  ...
</form>
B
}

You try to serve the image from images/img0001.gif. But that’s relative to the current directory – which will almost certainly be /cgi-bin when this code is executed. And most web servers are configured so that any files under /cgi-bin are assumed to be CGI programs.

So I’d guess that your web server is trying to execute your image file. Which isn’t going to work. What’s in the web server error log?

Move any static files (html, images, css) out of the /cgi-bin directory.

8

solved images on CGI or HTML files