Hi,
I trying to create web application that queries the database.The input from the form is not acquired by the variable and so correct output is not displayed.
May be my path is not correct - usr/bin/python..
can u suggest me...I m in dire need of help.
This is my HTML code:
this is python script
I trying to create web application that queries the database.The input from the form is not acquired by the variable and so correct output is not displayed.
May be my path is not correct - usr/bin/python..
can u suggest me...I m in dire need of help.
This is my HTML code:
Code:
<form method="POST" action="/test/simple1.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>
Code:
#!/usr/bin/python
# Import modules for CGI handling
import cgi
import cgitb;
cgitb.enable()
# Create instance of FieldStorage
form = cgi.FieldStorage()
# Get data from fields
first_name = form.getvalue('firstname')
last_name = form.getvalue('lastname')
#print "Content-type:text/htmlnn"
print "Content-type:text/html\n\n"
print "<html>"
print "<head>"
print "<title>Hello - Second CGI Program</title>"
print "</head>"
print "<body>"
print "<h2>Hello %s %s</h2>" % (first_name, last_name)
print "</body>"
print "</html>"
Comment