[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Why doesn't my "wallpaper" show?

Posted on 1998-08-20
4
Medium Priority
?
174 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 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

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…
Measuring Server's processing rate with a simple powershell command. The differences in processing rate also was recorded in different use-cases, when a server in free and busy states.
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses
Course of the Month18 days, 13 hours left to enroll

834 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