Solved

displaying html code

Posted on 1997-10-29
3
134 Views
Last Modified: 2013-12-25
I am setting up a script, and I am having probs!

when I type
perl script.pl  (or ./register.pl)

----------------\
Content-type: text/html

 <HTML><HEAD><TITLE>Form Incomplete</TITLE></HEAD>
<BODY>
....
</BODY></HTML>
-----------------/

but when I run it from my browser, I get:

-----------------\
500 Server Error

The server encountered an internal error or misconfiguration and was
unable to complete your request.

Please contact the server administrator, webmaster@cheathouse.com and
inform them of the time the error occurred , and anything you might have
done that may
have caused the error.

Error: HTTPd: malformed header from script
/usr/local/etc/httpd/cgi-bin/library/register/register.pl
------------------/

What could be wrong? Any help is greatly appreciated.

Jens Schriver
0
Comment
Question by:lovkraft
  • 2
3 Comments
 
LVL 84

Expert Comment

by:ozo
ID: 1831009
0
 
LVL 6

Accepted Solution

by:
alamo earned 100 total points
ID: 1831010
Even though the header looks fine when you run it locally and post it here, the header is the problem.

Could it be that due to bad program logic the "Content-type: text/html" header never gets written when it's run from the web?

Or could there be no blank line after it, i.e. you need
print "Content-type: text/html\n\n";    # note \n\n

To help debug this put the following line as the 2nd line in your file, so good headers are guaranteed. You can then see in text form what your program is writing, and it should be obvious why the server is rejecting your headers.

print "Content-type: text/plain\n\n";

0
 
LVL 6

Expert Comment

by:alamo
ID: 1831011
lovkraft, whatever happened with this? Did you get it working? If not we'll be happy to try to help further. If so - please grade this question (or reject my answer if was something else). Thanks and good luck!
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Introduction:   Welcome to my first article ever. To begin with, the reason I write this article.  I participated in a question on Experts Exchange about the start command in Windows and there were some discussion about the usage. The discussio…
In this tutorial I will show you how to make a simple HTML bar chart with the usage of WhizBase, If you want more information about WhizBase please read my previous articles at http://www.experts-exchange.com/ARTH_5123186.html (http://www.experts-ex…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
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…

705 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

11 Experts available now in Live!

Get 1:1 Help Now