#!/usr/bin/perl
# Send the Content-type.
print "Content-type: text/vnd.wap.wml \n\n";
# Send the WML header information.
print "<?xml version=\"1.0\"?>\n";
print "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.2//EN\""
. " \"http://www.wapforum.org/DTD/wml_1.2.xml\">\n";
# Retrieve the Web argument values from the standard input.
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@pairs = split(/&/, $buffer);
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/~!/ ~!/g;
$FORM{$name} = $value;
}
# Print the top part of the resulting page.
print <<EndofWML;
<wml>
<card title='Select Results'>
<p><br/>
You have selected:<br/>
EndofWML
@items = split(/;/, $FORM{cgi_items});
foreach $item (@items) {
print ("<i>$item</i><br/>");
}
# Print the last part of the resulting page.
print <<EndofWML;
<br/></p>
</card>
</wml>
EndofWML
|