Created
November 16, 2016 10:36
-
-
Save stnc/3d1b0712ca8615c4125f8b6ce061c66a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
#test için http://localhost:8000/cgi-bin/get_example.py?first_name=selman&last_name=tunc | |
# 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") | |
print() | |
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