#!/usr/bin/perl
sub GetArgs{
(*fval) = @_ if @_ ;
local ($buf);
if ($ENV{\'REQUEST_METHOD\'} eq \'POST\') {
read(STDIN,$buf,$ENV{\'CONTENT_LENGTH\'});
}
else {
$buf=$ENV{\'QUERY_STRING\'};
}
if ($buf eq "") {
return 0 ;
}
else {
@fval=split(/&/,$buf);
foreach $i (0 .. $#fval){
($name,$val)=split (/=/,$fval[$i],2);
$val=~tr/+/ /;
$val=~ s/%(..)/pack("c",hex($1))/ge;
$name=~tr/+/ /;
$name=~ s/%(..)/pack("c",hex($1))/ge;
if (!defined($CGI{$name})) {
$CGI{$name}=$val;
}
else {
$CGI{$name} .= ",$val";
#if you want multi-selects to goto into an array change to:
#$CGI{$name} .= "\\0$val";
}
}
}
return 1;
}
#End Of File
1;