in reply to Re: Extracting Cookies
in thread Extracting Cookies
$buffer = ""; read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); @pairs=split(/&/,$buffer); foreach $pair (@pairs) { @a = split(/=/,$pair); $name=$a[0]; $value=$a[1]; $value =~ s/\+/ /g; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1 +))/eg; $value =~ s/~!/ ~!/g; $value =~ s/\</\<\;/g; # html tag removal (remove t +hese lines to enable HTML tags in messages) $value =~ s/\>/\>\;/g; # html tag removal (remove t +hese lines to enable HTML tags in messages) $value =~ s/[\r\n]//g; if ($name eq "username") { $value =~ s/\s*$//g; } push (@data,$name); push (@data,$value); } %form=@data; %form;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Perfect example of why to use CGI.pm
by merlyn (Sage) on Aug 18, 2000 at 19:29 UTC | |
|
(Guildenstern) REx3: Extracting Cookies
by Guildenstern (Deacon) on Aug 19, 2000 at 01:04 UTC |