13.58.39.23 |    

Navigation

Google Advertisement

Die Funktion read_form() ermittelt die GET und POST Formulardaten und stellt sie im Hash %FM zur Verfügung.

read_form
  1. sub read_form {
  2.  
  3. my $buffer;
  4.  
  5. if ($ENV{'REQUEST_METHOD'} eq "GET") { $buffer = $ENV{'QUERY_STRING'}; }
  6. elsif ($ENV{'REQUEST_METHOD'} eq "POST") { read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); }
  7. my @pairs = split(/&/, $buffer);
  8.  
  9. foreach my $pair(@pairs) {
  10.  
  11.     my ($name, $value) = split(/=/, $pair);
  12.     $value =~ tr/+/ /;
  13.     $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
  14.     $name =~ tr/+/ /;
  15.     $name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
  16. 	$name =~ s/(\.x)|(\.y)//; # schaltet XY-Koordinaten von Image-Buttons aus...
  17.  
  18.     # Mehrere Datenfelder gleichen Namens als Kommagetrennte Liste (z.B. fuer Checkboxen)
  19.     if (defined $FM{$name}) { $FM{$name} = $FM{$name}.",".$value; }
  20.     else { $FM{$name} = $value; }
  21.  
  22. }
  23.  
  24. }
Parsed in 0.001 seconds at 579.79 KB/s

Search
 
Full text search by name and content of a snippet.

User online
There are 3 users online.

Tags Cloud

Latest snippets
str2seconds
(Bash::Function)
is_integer
(Bash::Function)
file_rotate
(Bash::Function)
confirm
(Bash::Function)
is_workingtime
(Bash::Function)
last day of last month
(Bash::Snippets)
crypt_apr1_md5
(PHP::Function)
crypt_apr1_md5
(Perl::Function)
transparent
(CSS)
rfc2822Toiso8601
(PHP::Function)