Stinger has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/local/bin/perl use CGI qw(:cgi-lib :standard); print header(); # Geturl.pl # # A little Perl script to read, decode and print the names # and values passed to it from an HTML Form thru CGI. # Get the HTML header, ender, define the page title. require "/cgi-local"; # full path ? to what ? # print "Content-type: text/html\n\n"; # another GTE addin $Title = "Get Information From a URL"; # Get the query string # $QueryString = $ENV{'QUERY_STRING'}; # Use split to make an array of name-value pairs broken at # the ampersand char. @NameValuePairs = split (/&/, $QueryString); # Put up an HTML header, page title, and a rule. &HTML_Header ($Title); print "<BODY>\n"; print "<H1>$Title</H1>\n"; print "<HR>\n"; # Split each of the name-value pairs and print them on the page. foreach $NameValue (@NameValuePairs) { ($Name, $Value) = split (/=/, $NameValue); print "Name = $Name, Value = $Value<BR>\n"; } &HTML_Ender;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(Ovid) Re: Beginning Perl and Forms
by Ovid (Cardinal) on Jan 19, 2001 at 02:53 UTC | |
by Maclir (Curate) on Jan 19, 2001 at 03:32 UTC | |
| |
|
Re: Beginning Perl and Forms
by j.a.p.h. (Pilgrim) on Jan 19, 2001 at 02:27 UTC | |
by Stinger (Initiate) on Jan 19, 2001 at 02:44 UTC |