Hi,
In order to create and image based web counter using Perl cgi on Windows 98 I am just trying to read an image into an html from a perl cgi script. But it does not work for some reason.
I have 3 files in my source directory. mycounter.html, mycounter.cgi and counter.jpg
Inside my html file mycounter.html I try to read image from the perl cgi script
using the line.
<img src = mycounter.cgi>
where mycounter.cgi is my perl cgi program with the following contents.
#!C:\Progra~1\Perl\bin\perl
use CGI;
$co=new CGI;
$size = stat("counter.jpg")[7];
open (FILEHANDLE,"<counter.jpg");
read FILEHANDLE,$imagedata,$size;
close FILEHANDLE
print
$co->header(-type=>'image/jpeg'),
"Below is my counter image file",
$imagedata;
Then I try to open mycounter.html from the browser. But all I see on the browser is
the string "Below is my counter image file" which it reads from the perl script but then there is no image at all (just a blank image).
Why is the html unable to read the image sent from the cgi script.
Once again I am running this on Windows 98 OS.
Your help will be greatly apprecited
thanks
grao5
(grao5@hotmail.com)