1 | Using the method "get" in a form to pass data, all the input that the user types is put in the QUERY_STRING variable: |
2 | <form method=get action="http://www.some.box/name.pl"> |
3 | Type your first name <input name="First Name"><br> |
4 | Type your last name <input name="Last Name"><br> |
5 | <input type=submit value="submit"> |
6 | </form> |
7 | If the user types "Winona" and "Ryder" as values, the QUERY_STRING environment variable would have the encoded value "First+Name=Winona&Last+Name=Ryder". |
8 | Here is a Perl program that would print that string on the web client's window (without regular html tags): |
9 | #!/usr/local/bin/perl |
10 | print "Content-type: text/html\n\n"; |
11 | print "You typed \"$ENV{QUERY_STRING}\" in the input boxes\n"; |
12 | Method=Get is NOT RECOMMENDED for forms as long input can be lost! |