Solved

displaying html code

Posted on 1997-10-29
3
144 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
Recently I have been answering a lot of questions like this in IT forums that I frequent. The question posed is usually something along the lines of "We have software X installed and need to uninstall it for reason Y" or some other variant of the sa…
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…
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 …

627 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