File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #!/usr/bin/python
2+
3+ # Import CGI and CGITB
4+ import cgi , cgitb
5+
6+ # Create a form object
7+ form = cgi .FieldStorage ()
8+
9+ # Get form data Full Name and Favorite TV Show
10+ fullname = form .getvalue ('fullname' )
11+ tvShow = form .getvalue ('tvShow' )
12+
13+ print "Content-type:text/html\r \n \r \n "
14+ print "<html>"
15+ print "<head>"
16+ print "<title>TV Viewer Profile</title>"
17+ print "</head>"
18+ print "<body>"
19+ print "<h2>Hello " + str (fullname ) + "</h2>"
20+ print "<p> Your favorite TV show is: " + str (tvShow )
21+ print "</body>"
22+ print "</html>"
Original file line number Diff line number Diff line change 1+ < HTML >
2+ < HEAD >
3+ < TITLE > FORM EXAMPLE</ TITLE >
4+ </ HEAD >
5+ < BODY >
6+ < FORM action ="cgi-bin/cgiPython.py " method ="post ">
7+ Full Name: < input type ="text " name ="fullname "> < BR >
8+ Favorite TV Show: < input type ="text " name ="tvShow "> < br >
9+ < input type ="submit " value ="Submit " />
10+ </ FORM >
11+ </ BODY >
12+ </ HTML >
You can’t perform that action at this time.
0 commit comments