**************************************************
before watching this video please whatch this video to configure your setup • Lesson - 62 : Python Advanced - Python CGI...
Python Core PlayList : • Lesson - 01 : Python3 - What is python
Python Advanced PlayList : • Lesson - 46 : Python Advanced - Python OOP...
**************************************************
Python CGI Programming : Passing Information Using POST Method:
A generally more reliable method of passing information to a CGI program is the POST method. This packages the information in exactly the same way as GET methods, but instead of sending it as a text string after a ? in the URL it sends it as a separate message. This message comes into the CGI script in the form of the standard input.
Below is same hello_get.py script which handles GET as well as POST method.
Example :
#!/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>”
<form action="/cgi-bin/hello_get.py" method="post">
First Name: <input type="text" name="first_name"><br /> Last Name: <input type="text" name="last_name" /> <input type="submit" value="Submit" />
</form>
Sample Projects : https://github.com/SadaLearningHub1/P...
Nesta página do site você pode assistir ao vídeo on-line Lesson - 66 : Python Advanced - Python CGI Programming : Passing Information Using POST Method duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Sada Learning Hub 23 Janeiro 2018, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 982 vezes e gostou 7 espectadores. Boa visualização!