Skip to content

Instantly share code, notes, and snippets.

@fapestniegd
Created May 29, 2013 17:14
Show Gist options
  • Save fapestniegd/5672009 to your computer and use it in GitHub Desktop.
Save fapestniegd/5672009 to your computer and use it in GitHub Desktop.
#!/usr/bin/python
# Import modules for CGI handling
import cgi, cgitb
# Create instance of FieldStorage
form = cgi.FieldStorage()
# Get data from fields
first_name = form.getvalue('first_name')
last_name = form.getvalue('last_name')
print "Content-type:text/html\r\n\r\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>"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment