473,387 Members | 1,925 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Malformed header error... pls help!

hello,
Im getting this error everytime i load this page.
[error] [client 127.0.0.1] malformed header from script. Bad
header=*** You don't have the (right): c:/program files/apache
group/apache/cgi-bin/fig28_18.py

I have connected all databases already. If I remove the import MySQL
statement, theres no problem. But i need to use the database. . what
could possibly be wrong???

pls help.. I have the MySQLdb installed in my Python directory
already..
#!c:\Python23\python.exe

import cgi
import MySQLdb
def printContent():
print "Content-type: text/plain\n\n"
print
print """
<html xmlns = "http://www.w3.org/1999/xhtml" xml:lang="en"
lang="en">
<head><title>Registration results</title></head>
def printReply():
from convert import genPrime, genPrimeE
p1 = genPrime()
q1 = genPrime()
e1 = genPrimeE()
N1 = p1 * q1
M1 = (p1-1)*(q1-1)
print 'e1 %d, m1 %d' %(e1,M1)

while(e1 % M1 == 0):
e1 = genPrimeE()

connection = MySQLdb.connect( db = "try" )

cursor = connection.cursor()
cursor.execute("insert into trials (p,q,n,m) values
('p1','q1','n1','m1');")
authorList = cursor.fetchall()
cursor.close() # close cursor
connection.close()
printContent()
form = cgi.FieldStorage()

personInfo = { 'firstName' : form[ "firstname" ].value,
'lastName' : form[ "lastname" ].value,
'email' : form[ "email" ].value,
'phone' : form[ "phone" ].value,
'book' : form[ "book" ].value,
'os' : form[ "os" ].value,
'message' : form["message"].value }
printReply()
Jul 18 '05 #1
1 6091
Kiran B. <ki********@yahoo.com> wrote:
hello,
Im getting this error everytime i load this page.
[error] [client 127.0.0.1] malformed header from script. Bad
header=*** You don't have the (right): c:/program files/apache
group/apache/cgi-bin/fig28_18.py

I have connected all databases already. If I remove the import MySQL
statement, theres no problem. But i need to use the database. . what
could possibly be wrong???


My guess ... you have something wrong with the MySQL installation.
Probably the import statement throws an exception, which your other
software reads as a malformed header (which it is). You need to get
the actual error message (ie the contents of that header, or run the
script differently to see the exception) and then solve the problem
that it reports.

-D

--
"Don't use C; In my opinion, C is a library programming language
not an app programming language." - Owen Taylor (GTK+ developer)

www: http://dman13.dyndns.org/~dman/ jabber: dm**@dman13.dyndns.org
Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Magnus Lie Hetland | last post by:
According to The Sgmlop Module Handbook , the handle_entityref() callback is called for "malformed character entities". What does that mean, exactly? What is a malformed character entity? I've...
0
by: Ian A. York | last post by:
MacOS 10.3.8, Python 2.3. I installed both Tkinter and appscript yesterday. Now when I open python (or pythonw) in the Terminal I get the following: Python 2.3 (#1, Sep 13 2003, 00:49:11) on...
1
by: lawrence | last post by:
Hey, I'm working on a PHP script to make an RSS feed for my weblog. I've got a "malformed" error at this validator: ...
2
by: Karthik | last post by:
When I try to compile my VC++ program (am Using VS6.0). I get the following error in a header file ATLCONV.H. c:\program files\microsoft visual studio\vc98\atl\include\atlconv.h(52) : error...
6
by: sviau | last post by:
http://www.mls.ca/PropertyDetails.aspx?vd=&SearchURL=%3fMode%3d0%26Page%3d1%26vs%3d1%26rlt%3d%26cp%3d%26pt%3d1%26mp%3d0-0-0%26mrt%3d-1-0-0%26Beds%3d0-0%...
0
by: Alicia Marinache | last post by:
Hello I do have a sudden problem with my Visual Studio (.NET Framework 1.1, Visual Studio 2003 version). All was fine and well until 2 days ago when unexpectedly I started to receive the following...
0
by: sridhar | last post by:
hey friends i am trying to sign a message using x.509 certificate and i get the {"Malformed reference element."} error when calling ComputeSignature method.can any one help me on this please...
1
by: Shalako | last post by:
I check my error log and see these entries: malformed header from script. Bad header= Missing gauge reports are ind: padata.pl /perl/pema/padata.pl did not send an HTTP header malformed...
8
by: madevo8 | last post by:
Hi All I am getting a 500 internal server error plus the below message in my log file when trying to execute a script. malformed header from script. Bad header=/home/fhlinux159/f/*domain*:...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.