use the following sub to read post input
I got this from a book
if you only want the regxp its in this code


ex:-

%postdata= readPostInout(Max Total Size of Data in Bytes);

# this will return form data as Field=Value pares to the %postdata hash
# if the Total size of data is grater than Given Max Total Size of Data in
Bytes the function will abrt the retreve
# if you dont want to limit size use

%postdata= readPostInout(0);


#There are built in functions in CGI module too you cam try to use them
insted of this



#___________________________________________________________________________
_______________________
# Add this sub to your code
sub readPostInput($){  #*************************************************
Reading Post Input
my ($maxlength)=@_;
my(%searchField, $buffer, $pair, @pairs);
if (($ENV{'REQUEST_METHOD'} eq
'POST')&&(($maxlength>=$ENV{'CONTENT_LENGTH'}||($maxlength==0)))){



   read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});

   @pairs = split(/&/, $buffer);



$pairc = -1;

 while($pairc < $#pairs){
$pairc++;
     $pair = $pairs[$pairc];




     ($name, $value) = split(/=/, $pair);
     $value =~ tr/+/ /;
     $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
     $name =~ tr/+/ /;
     $name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
    $searchField{$name} = $value;


 }
  }

return (%searchField);
}


#___________________________________________________________________________
_______________________________





Sign L Rakhitha Malinda Karunarathne Web :- rakhitha.cjb.net Email
:[EMAIL PROTECTED] Rakhitha Malinda Karunarathne.
----- Original Message -----
From: "Colin Johnstone" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, January 12, 2003 7:58 AM
Subject: funny characters in form field


> Gidday all,
>
> In my mailing list form I have a hidden field that stores the date the
> subscriber subscribed.
>
> When processing the form the date in this format 3/1/2003 is converted to
> 3%2F1%2F2003.
>
> Can someone give me a regex to convert it back again please. Im only new
to
> perl and am struggling with regex's
>
> thanking you in anticipation
>
> Colin
>
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to