Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

displaying html code

Posted on 1997-10-29
3
Medium Priority
?
148 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 200 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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

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…
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…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

715 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