#!/usr/local/bin/perl



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; # get rid of SSI

	$in{$name} = $value;

}



$name = $in{'name'};

$age = $in{'age'};

$gender = $in{'gender'};

$married = $in{'married'};

$continent = $in{'continent'};

$comments = $in{'comments'};



print "Content-type: text/html\n\n";

print <<"PRINTPAGE";



<HTML>

<HEAD>

<TITLE>The Dynamic Duo - Form Results</TITLE>

</HEAD>

<BODY>

Hello $name,

<P>You are:

<UL>

<LI>a $age year old $gender

<LI>$married married

<LI>living in $continent

</UL>

<P>This is what you had to say:

<DL><DD>$comments</DL>

</BODY>

</HTML>



PRINTPAGE