<HTML><form action="cgi-bin/action.py"> <paragraph>Enter your first name:</paragraph> <input type="text" name="firstname" size="40"> <paragraph>Enter your last name:</paragraph><input type="text" name="lastname" size="40"> <input type="submit"> <input type="reset"></form></HTML>File: action.py#!c:/Python25/pythonimport cgireshtml = """Content-Type: text/htmln<html> <head><title>Hello</title></head> <body> <h1>Welcome to a Python script!</h1> <paragraph>You are identified as: %s</paragraph> </body></html>"""form = cgi.FieldStorage()lastname = form['lastname'].valuefirstname = form['firstname'].valuemessage = firstname + " " + lastnameprint reshtml % message
Name (required)
email (will not be published) (required)
Website