On Thu, 12 Dec 2002 19:46:04 -0700, [EMAIL PROTECTED] (Eric) wrote:

>in their html webpage I add a line as
>
><img src="http://www.linuxspice.com/cgi-bin/showphoto.pl";> </Br>

This requires that you send an image , not html as your script does
below.

>
>and in my C:/apache2/cgi-bin/showphoto.pl
>#!c:\perl\bin\perl.exe
>use strict;
>use CGI qw(:standard);
>print "Content-type:  text/html\n\n";
>print "<HTML><BODY>";
>print "</Br> This is an exmaple CGI script</Br>.\n";
>print "</table>
></Br>
><table border=0 width=\"200\"
>class=\"rightsidebar\">
><tr><td><img src=\"computer2G.jpg\" width=\"200\" height=\"150\"> </td></tr>
></table>
></Br>";
>print "</BODY></HTML>";
>----------------------------------------------------
>but it still dispaly no photo as computer2G.jpg should have
>I use <a href="http://www.mycompany.com/computer2G.jpg>   ----        it
>work if I click on that hyperlink

The fact that the above link works, means you have the photo there, it
dosn't mean the script is working.

What happens if you click on :
http://www.linuxspice.com/cgi-bin/showphoto.pl
it sends an html page, not a photo( although the html contains a photo).


I'm pretty sure your showphoto.pl script needs to actually
send the image, NOT just a link to the image.

Try something like this for showphoto.pl
##############################################
#!/usr/bin/perl
use strict;
print("Content-type:  Image/jpg\n\n");

local $/ = undef; # file slurp mode 
open(INFILE, "</path/to/image.jpg");
my $img = <INFILE>;
close(INFILE);
binmode STDOUT;
print $img;
exit;
#################################################

If you put this in a script all of its own, then you can use it in an 
image tag when printing out your html like so: 
<img src="http://yourdomain.com/cgi-bin/showphoto.pl";> 







-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to