Solved

Why doesn't my "wallpaper" show?

Posted on 1998-08-20
4
167 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

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 …
Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

809 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