We pass information to a CGI program in the POST method. And post packages give the information in exactly the same way as GET methods but instead of sending it as a text string after using post. In the URL it sends it as a separate message. This message comes into the CGI script in the form of the standard input and output.
For example you can see below code.
#!/Dinesh/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('Test')
last_name = form.getvalue('Demo')
print "Content-type:text/html\r\n\r\n"
print ""
print ""
print "Hello - Second CGI Program"
print ""
print ""
print "Hello %s %s" % (Test, Demo)
print ""
print ""
0 Comment(s)