Forum Moderators: coopster & phranque

Message Too Old, No Replies

To hard to explain on one line :/

3 out of 4 things work in this script

         

jt101

3:12 pm on Jan 29, 2004 (gmt 0)

10+ Year Member



Im very new at CGI. Below is my script. 3 out of 4 things work. No errors. The <body background> part.

print "Content-type: text/html\n\n";
use CGI::Carp 'fatalsToBrowser';
if ( -e $greybackground.gif) { print "exists"};
print <<"EOF";
<HTML>

<HEAD>
<TITLE>join.success</TITLE>
</HEAD>

<BODY background=greybackground.gif>
<align=\"center\">
Submition Succesfull!\n

<H1><a href=\"http://pathto.mywebserver.net/home.html\"> <font size=\"5\">Home</font></a>\n</H1>
</BODY>

</HTML>
EOF

Everything else works. And no errors. But also no background :/

tombola

3:15 pm on Jan 29, 2004 (gmt 0)

10+ Year Member



Welcome to WebmasterWorld!

What happens when you use quotes?

<BODY background="greybackground.gif">

instead of:

<BODY background=greybackground.gif>

jt101

11:46 pm on Jan 29, 2004 (gmt 0)

10+ Year Member



Tryed WITH quotes, without and even \"background.gif\"

All the same. No cigar

tombola

9:18 am on Jan 30, 2004 (gmt 0)

10+ Year Member



Hmm... maybe it's a dumb question, but did you upload that background image to the appropriate directory on your server?
Also, did you upload that image as a binary file?

jt101

9:35 am on Jan 30, 2004 (gmt 0)

10+ Year Member



Roger on both questions

volatilegx

12:36 am on Feb 2, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



have you tried using the full URL of the greybackground.gif in the body tag?

moltar

12:42 am on Feb 2, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I tried your code, and it works if you have the image "greybackground.gif" in the same directory. The problem is that you might not be able to load images from cgi-bin, the server tries to execute the image, which is impossible. But it doesn't show any errors, since it's a background image. Try putting it somewhere else (above cgi-bin).

You can test it by typing a full path to your image and see if it actually shows the image or gives you a 500 error. Something like:

http*//www.widgets.com/cgi-bin/greybackground.gif

jt101

1:01 am on Feb 2, 2004 (gmt 0)

10+ Year Member



Yes! The poroblem WAS the full path. It now works
Thanks