Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CGI file path problem

Status
Not open for further replies.

JNameNotTaken

Programmer
Aug 29, 2006
24
IE
Hi All

I have a Perl CGI script which generates HTML code dynamically.

for example: -

printHTML();

sub printHTML() {
return <<"end";
<IMG SRC="my_image.gif"><BR>
Some Text<BR>
end
}

My problem is that the .gif file is not being displayed when I post the script on the (linux) server.
The .gif file is in the same directory as the cgi file.
Permissions are set correctly on the .gif file.

If anyone can point me in the right direction here it will be very much appreciated.
Thanks
John
 
you may find all files in the cgi-bin are set via the server to be executed as if .pl / .cgi files.

I used to use this method to protect my .txt flat file system.

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
1DMF

Thanks very much. Your theory appears to be correct. I moved the .gif files out of the cgi-bin directory, changed the paths in the cgi script, now everything appears to be ok.

Thanks for your help.
 
no probs, glad i could help :)

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
you may find you run into other problems if you continue using prototypes instead of sub routines:

sub printHTML() {[/b[ this is a prototype because of the () after the sub name.

You should just use:

sub printHTML {



 
what does that mean kevin, prototype ?

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
KevinADC,

I'm curious too. What kind of problems am I likely to run into?

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top