Wednesday
April 23, 2014

Homework Help: computer programming (PYTHON)

Posted by james on Friday, November 23, 2007 at 10:28pm.

My first page is
<html>
<head>
<title>Name Game</title>
</head>
<body>
<h1>Name Game</h1>

<form action="namegame.py">
<p>
Enter your name: <input type="text" name="name" />
</p>
<p>
<input type="submit" value="Go" />

</p>
</form>
</body>
</html>

My second .py page is
import cgi
form = cgi.FieldStorage()
name = form["name"].value

print """Content-type: text/html

<html>
<head>
<title>Name Game</title>
</head>
<body>
"""
# print HTML body using form data
print "<h1>Name Game</h1>"
print "<dl>"
print "<dt>form["name"].value</dt>"
print "<dd> name </dd>"
print "<dt>Uppercase</dt>"
print "<dd>upper(form["name"].value)</dd>"
print "<dt>No spaces</dt>"
print "<dd></dd>"
print "<dt>No vowels</dt>"
print "<dd></dd>"
print "</dl>"
print "</body></html>"


I want to ask how come form["name"].value is invalid when it is loading the second page?? I just want to show form["name"].value to be the word that the person entered at the first page?? thank you very much

Answer this Question

First Name:
School Subject:
Answer:

Related Questions

computer programming (PYTHON) - My first page is <html> <head> <...
Web application development JSP - Below is the following jsp code for a homework...
Math - help with these questions~ Thank you 1. Determine the interval(s) on ...
Precalculus - 1. Determine the interval(s) on which x^2 + 2x -3>0 a)x<-3, ...
programming - In order to share an XML file among different systems and programs...
programming - In order to share an XML file among different systems and programs...
math - Um... i cant find anything about this in the textbook, help??!! 1. m - 7...
Precalculus - Help with these questions help with these questions~ Thank you 1. ...
Science -CHECK MY WORK- - a.) How can you describe the location of vanadium (V, ...
Computers (XML) - employees.xml <?xml version="1.0" encoding="UTF-8"?> <...

Search
Members