Solved

displaying html code

Posted on 1997-10-29
3
139 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

In this tutorial I will aim to show you how simple is making a small application in WhizBase, how to add, remove and update data in the DB. I will make a small address book application where you can add, browse, update and remove addresses. I wi…
If you get a (Blue Screen of Death), your system writes a small file called a minidump. Your first step is to make certain your computer is setup to record memory dumps. Right click My Computer, choose properties. Click on the advanced tab, an…
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…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…

816 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