Basic HTML version of Foils prepared 2 Sept 1997

Foil 9 Another way to pass data through environment variables

From CGI Programming with Advanced Topics Jackson State University Mississippi -- Fall Semester 97. by Nancy McCracken *

Using the method "get" in a form to pass data, all the input that the user types is put in the QUERY_STRING variable:
<form method=get action="http://www.some.box/name.pl">
Type your first name <input name="First Name"><br>
Type your last name <input name="Last Name"><br>
<input type=submit value="submit">
</form>
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".
Here is a Perl program that would print that string on the web client's window (without regular html tags):
#!/usr/local/bin/perl
print "Content-type: text/html\n\n";
print "You typed \"$ENV{QUERY_STRING}\" in the input boxes\n";
Method=Get is NOT RECOMMENDED for forms as long input can be lost!



© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Tue Sep 2 1997