#! /usr/local/bin/perl

do '/com/doc/web-support/cgi-hacks.pl';

&find_form_args ('name|candy|quantity');

&cgidie ('You forgot to specify your name!') if $name eq '';
&cgidie ('The quantity must be a positive integer')
  if $quantity !~ /^\s*[0-9]+\s*$/;

$host = $ENV{'REMOTE_HOST'};

print <<EOF;
Content-type: text/html

<title>Thanks for your order</title>
<h1>Thanks for your order</h1>

Dear $name, <p>

Thanks for ordering our quality $candy.  Your order of $quantity
boxes is on its way! <p>

It will arrive as soon as we can figure out how to send fattening
email to $host. <p>

Marvin P. Android <br>
President
EOF
