|
Is anyone doing Perl and WML/wap programming?
I've just started, and can't work out how to grab data from a wml form. I have tried the post method : -- #parse form data read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
$postinput = $buffer;
@pairs = split(/&/, $buffer);
$postinput =~ s/&/\n/g;
$postinput =~ s/\+/ /g;
$postinput =~ s/%([\da-f]{1,2})/pack(C,hex($1))/eig;
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$value =~ s/<!--(.|\n)*-->//g;
$FORM{$name} = $value;
}
and the get method : -- if($ENV{'QUERY_STRING'}){ $cde="$ENV{'QUERY_STRING'}";
#start parsing if a query string @pairs = split(/&/, $cde);
# For each name-value pair: #
foreach $pair (@pairs) {
# Split the pair up into individual variables. #
local($name, $value) = split(/=/, $pair);
$FORM{$name} = $value; }}
Can I access some type of wml environment variables?
*****************************
Han Fleet Programmer AvaterraUK www.avaterra.com www.vzones.com www.juiceuk.com |
- Re: wap/wml and Perl dave fleet
- Re: wap/wml and Perl Tom Cooper
- Re: wap/wml and Perl Austin S. Lin
