Solved

Why doesn't my "wallpaper" show?

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Ever wondered how to display how many visitors you have online. In this tutorial I will show you an easy but effective way to display the number of online visitors in WhizBase. In this article I assume you have read my previous articles and know …
Making a simple AJAX shopping cart Couple years ago I made my first shopping cart, I used iframe and JavaScript, it was very good at that time, there were no sessions or AJAX, I used cookies on clients machine. Today we have more advanced techno…
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.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

762 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now