jimbob2812
03-26-2003, 09:16 AM
I have created a perl script called "photo.pl" -
#! /usr/bin/perl
$photo=$ENV{QUERY_STRING};
print "Content-Type: text/html\n\n";
print "<html><head><title>James Davies - Photo</title></head><body>"
print "<img src=\"pics/$photo.jpg\" />\n";
print "</body></html>\n";
This is correctly interpreted by my server to give the following HTML code (when invoked with "?img01big" as the query string at the end of the URL...) -
<html><head><title>James Davies - Photo</title></head><body>
<img src="pics/img01big.jpg" />
</body></html>
But the image is not displayed. When I copy the generated HTML code from the web to my local PC into the directory where the original "photo.pl" source is, it works as expected and the photo is displayed.
I have checked the authorities and that the directory "pics" exists with the image inside. All ok...
The web log on my server has this which I guess is the problem - somehow it has decided to insert the "/html" into the path name -
14:44:36 2003] sbox: exec of /users/netm/domains/netmotorway.co.uk/html/cgi-bin/james/gite/pics/img01big.jpg failed
But the bizare thing is that the directory "cgi-bin" is held within the top level directory of netmotorway.co.uk...
Can anyone help me find out what is going on please, as this is driving me mad...Cheers, James
#! /usr/bin/perl
$photo=$ENV{QUERY_STRING};
print "Content-Type: text/html\n\n";
print "<html><head><title>James Davies - Photo</title></head><body>"
print "<img src=\"pics/$photo.jpg\" />\n";
print "</body></html>\n";
This is correctly interpreted by my server to give the following HTML code (when invoked with "?img01big" as the query string at the end of the URL...) -
<html><head><title>James Davies - Photo</title></head><body>
<img src="pics/img01big.jpg" />
</body></html>
But the image is not displayed. When I copy the generated HTML code from the web to my local PC into the directory where the original "photo.pl" source is, it works as expected and the photo is displayed.
I have checked the authorities and that the directory "pics" exists with the image inside. All ok...
The web log on my server has this which I guess is the problem - somehow it has decided to insert the "/html" into the path name -
14:44:36 2003] sbox: exec of /users/netm/domains/netmotorway.co.uk/html/cgi-bin/james/gite/pics/img01big.jpg failed
But the bizare thing is that the directory "cgi-bin" is held within the top level directory of netmotorway.co.uk...
Can anyone help me find out what is going on please, as this is driving me mad...Cheers, James