Hi Ajay,
You have missed HTTP header line in your python script.

On Wednesday 05 May 2004 14:15, ajay singh wrote:
> ------------------------------------------------
> CGI Error
> The specified CGI application misbehaved by not
> returning a complete set of HTTP headers. The headers
> it did return are:
> -----------------------------------------------
>
>
> The Python code is as below:
>
> --------------------------------------------
>
> #!c:\python23\python
> import cgi
> import sys,os
> import string
> import MySQLdb

add here this line as
print "Content-Type: text/html\n\n"

> db=MySQLdb.connect(host="localhost",user="root",passwd="",db="power")
> cursor=db.cursor()
> print "<html>"
> print "<head>"
> print "</head>"
> print "<body>"
> s=os.environ['QUERY_STRING']
> q=cgi.parse_qs(s)
> sname=q['txtname'].pop()
> scapacity=q['capacity'].pop()
> sstate=q['txtstate'].pop()
> sregion=q['region'].pop()
> sfre1=q['frequency1'].pop()
> sfre2=q['frequency2'].pop()
> sfre3=q['frequency3'].pop()
> sfre4=q['frequency4'].pop()
> cursor.execute("insert into
> station(name,region,capacity,state,fre1,fre2,fre3,fre4)
> values(%s,%s,%s,%s,%s,%s,%s,%s)",
> (sname,sregion,scapacity,sstate,sfre1,sfre2,sfre3,sfre4))
>
> print "</body>"
> print "</html>"

HTH
Abhiram

_______________________________________________
ilugd mailinglist -- [EMAIL PROTECTED]
http://frodo.hserus.net/mailman/listinfo/ilugd
Archives at: http://news.gmane.org/gmane.user-groups.linux.delhi 
http://www.mail-archive.com/[EMAIL PROTECTED]/

Reply via email to