Article 14613 of comp.infosystems.www: Xref: feenix.metronet.com comp.infosystems.www:14613 Path: feenix.metronet.com!news.utdallas.edu!wupost!gumby!newsxfer.itd.umich.edu!jobone!lynx.unm.edu!mimbres.cs.unm.edu!bbx!tantalum!edsr!tad!news From: ssd@tad.eds.com (Sean Dowd) Newsgroups: comp.infosystems.www Subject: Re: Forms (POST) and PERL Message-ID: Date: 29 Apr 94 14:16:04 GMT References: <2pk7r4INNrcc@srvr1.engin.umich.edu> <5515@map.mdavcr.mda.ca> Sender: news@tad.eds.com Reply-To: ssd@tad.eds.com Organization: EDS Technology Architecture, Plano, TX Lines: 37 In-Reply-To: rdr@mdavcr.mda.ca's message of 29 Apr 94 00:01:38 GMT Nntp-Posting-Host: calvin This is the one I use: #!/usr/local/bin/perl # also uses shellparse to get the query parms in a readable format. sub parse_query { local($lqs) = @_; (@localparms) = split(/&/,$lqs); $nparms = scalar(@localparms); foreach $p (@localparms) { ($pname,$pvalue) = split(/=/, $p); $pvalue =~ s/\+/ /g; $pvalue =~ s/%([0-9a-fA-F][0-9a-fA-F])/sprintf("%c",hex($1))/eg; $parms{$pname} = $pvalue; } } do parse_query ($qs = $ENV{'QUERY_STRING'}); print "Here are your answers:

"; print "

";
foreach $key (sort(keys(%parms))) {
	# strip off newlines
	$parms{$key} =~ s/
	$parms{$key} =~ s/\n/ /g;
	$parms{$key} =~ s/\r/ /g;
	print "$key: $parms{$key}\n";
}
print "
"; -- =========================================================================== Sean S. Dowd ssd@tad.eds.com (pc4x400.sdowd01@diamond.gmeds.com) EDS Technology Architecture, Plano, TX #include