Malformed Header

Kiran Budhrani kiranb_102 at
Mon Nov 3 14:32:33 CET 2003

hello eric, 

Im getting this error: 
[error] [client] malformed header from script. Bad
header=*** You don't have the (right): c:/program files/apache

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


import cgi
import MySQLdb

def printContent():
   print "Content-type: text/html\n\n"
   print """
<html xmlns = "" xml: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
   authorList = cursor.fetchall()
   cursor.close()                  # close cursor

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 }

Eric Wichterich <eric.wichterich at> wrote: 
Hi Kiran,

could you post the exact error entry from your error_log, please?


Am Montag, 03.11.03 um 06:18 Uhr schrieb Kiran Budhrani:

> Hi eric, I havent solved my problem... do u have any suggestions?
> what could possibly be wrong.. Im using Apache as my server and the 
> error appears in the error log.
> pls help.. thanks! =)
> Eric Wichterich wrote:
> Hello Kiran,
> just wanted to ask whether your problem is already solved (if found not
> further postings to this thread).
> Greetings,
> Eric

Do you Yahoo!?
Exclusive Video Premiere - Britney Spears
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list