Basic python help

K

Kevin Feng

I have the following simple html file that is trying to send data to a
python script, however, I am getting a weird server error:

This is my HTML:

<html>
<FORM METHOD="POST" ACTION="../cgi-bin/quoteprice2.py">
Ticker 1
<input type="text" name="ticker1" size=10>
<br>

<input type="submit" value="Submit">
<input type="reset" value="Reset">
</form>
</html>


This is my Python:

#!/usr/bin/python

import cgi
print "Content-type: text/html"
print

form = cgi.FieldStorage()
print form.keys()

print "<br>"

for x in form.keys():
print "%s=%s" % (x, form[x].value) + "<br>"


This is my error

Internal Server Error

The server encountered an internal error or misconfiguration and was unable
to complete your request.

Please contact the server administrator, root@localhost and inform them of
the time the error occurred, and anything you might have done that may have
caused the error.

More information about this error may be available in the server error log.



Any suggestions? Much thanks.
 
G

Gregor Horvath

Kevin said:
More information about this error may be available in the server error log.



Any suggestions? Much thanks.

What does the error log of the webserver say?
 
J

John M. Gabriele

(Please don't top-post -- fixed)

Kevin said:
> No idea, I do not have permission to access the error log.
>
>

In your cgi script, try putting "import cgitb; cgitb.enable()"
on the next line right after "import cgi".

Also try changing your POST to GET.

---John
 
D

Dennis Lee Bieber

Internal Server Error

The server encountered an internal error or misconfiguration and was unable
to complete your request.

Please contact the server administrator, root@localhost and inform them of
the time the error occurred, and anything you might have done that may have
caused the error.

More information about this error may be available in the server error log.



Any suggestions? Much thanks.

Uhm... contact the admin like the error message says?

Are you sure the server supports Python for CGI?

--
 

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
473,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top