Solved

Why doesn't my "wallpaper" show?

Posted on 1998-08-20
4
168 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
  • 3
4 Comments
 

Author Comment

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

Accepted Solution

by:
evilgreg earned 30 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

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

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

In this tutorial I will show you how to provide a dynamic RTF document on your website generated with data from your database. For this tutorial you will need Microsoft Word or WordPad, WhizBase and Microsoft Access. In this tutorial I will show …
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

821 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