An error ?

B

Bo Yang

Hi ,
I am confronted with an odd question in the python cgi module !

Below is my code :

import cgitb ; cgitb.enable()
import cgi

print "Hello World !"

How easy the script is , and the url is 202.113.239.51/vote/cgi/a.py
but apache give me a 'Server internal error !'
and the error log is :


[Fri Jun 16 14:06:45 2006] [error] [client 10.10.110.17] malformed
header from script. Bad header=Hello World!: a.py

I wish somebody could help me , thanks in advance !

Best Regard !
 
R

Rene Pijlman

Bo Yang:
[Fri Jun 16 14:06:45 2006] [error] [client 10.10.110.17] malformed
header from script. Bad header=Hello World!: a.py

"The output of a CGI script should consist of two sections, separated by a
blank line. The first section contains a number of headers, telling the
client what kind of data is following."
http://docs.python.org/lib/cgi-intro.html
 
D

Dennis Lee Bieber

import cgitb ; cgitb.enable()
import cgi

print "Hello World !"
said:
[Fri Jun 16 14:06:45 2006] [error] [client 10.10.110.17] malformed
header from script. Bad header=Hello World!: a.py

Aren't you supposed to supply the reply HTTP headers before the page
data?

This seems to be stating that it is seeing your "Hello World!" as
the protocol headers.

Read section 11.2.1 of the Library Reference...
--
Wulfraed Dennis Lee Bieber KD6MOG
(e-mail address removed) (e-mail address removed)
HTTP://wlfraed.home.netcom.com/
(Bestiaria Support Staff: (e-mail address removed))
HTTP://www.bestiaria.com/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,430
Messages
2,571,676
Members
48,796
Latest member
Greg L.

Latest Threads

Top