[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Why doesn't my "wallpaper" show?

Posted on 1998-08-20
4
Medium Priority
?
172 Views
Last Modified: 2013-12-25
I have a wallpaper background I would like my CGI program (on a UNIX server) to use when it returns a page to the user. Here is an example:

#part of a cgi program
sub error {

      print<<EOF;
Content-type: text/html

<HTML>
<HEAD>
<TITLE>Error</TITLE>
</HEAD>
<BODY BACKGROUND="bground.gif">
<P>Name and address fields must be filled in for this form to be submitted successfully
</BODY>
</HTML>
EOF
}

When I do this, I get the annoying "Document contains no data". However, if I omit BACKGROUND=bground.gif, the program works, and I get the defalut grey background. I have 2 copies of bground.gif - one in my public_html directory and the other in my cgi-bin. What am I doing wrong?
0
Comment
Question by:zgee
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 

Author Comment

by:zgee
ID: 1828218
Edited text of question
0
 
LVL 1

Accepted Solution

by:
evilgreg earned 120 total points
ID: 1828219
Hard to say. The only way that the browser will report "No data" is if

1) The line Content-type: text/html\n\n was sent.
2) And nothing else.

Nothing in your code is inherently wrong, although I would recommend a few things:

1) Move the content-type outside the print error section:
2) Use something besides "EOF", and put it in quotes:

sub error {
print "Content-type: text/html\n\n";
print<<"ENDOFERROR";
<HTML>
etc....
ENDOFERROR
}

Other than that, I would look for typos. There is no reason for whatever is in the BODY quotes to affect the output so drastically as you describe.

Finally, make sure you are buffering your output by adding a
$|++;
or even a
$|=1;
at the top of your program.


0
 

Author Comment

by:zgee
ID: 1828220
Thanks, evilgreg.

I will try what you suggested tomorrow...
0
 

Author Comment

by:zgee
ID: 1828221
I've done what you suggested above, however the wallpaper still doesn't show.....
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It is a general practice to get rid of old user profiles on a computer  in a LAN environment. As I have been working with a company in a LAN environment where users move from one place to some other place at times. This will make many user profil…
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question