Cannot execute Py script in CGI-BIN

Status
Not open for further replies.

josh-r-m43

New Member
Messages
1
Reaction score
0
Points
0
Hello, my name is Josh. I am trying to execute a python script from my cgi-bin, and am doing so properly however I am constantly receiving an error: "The page you are looking for is temporarily unavailable.
Please try again later. "

code is correct

<form method="POST" action="/cgi-bin/test.py">

<p>Your first name: <input type="text" name="firstname">

<p>Your last name: <input type="text" name="lastname">

<p>Click here to submit form: <input type="submit" value="Yeah!">

<input type="hidden" name="session" value="1f9a2">

</form>



#!/usr/bin/env python

import cgi

def main():
print "Content-type: text/html\n"
form = cgi.FieldStorage()
if form.has_key("firstname") and form["firstname"].value != "":
print "<h1>Hello", form["firstname"].value, "</h1>"
else:
print "<h1>Error! Please enter first name.</h1>"

main()

and I have done my chmod on test.py for 755, all executable rights, what's going on?
 
Status
Not open for further replies.
Top