#! /usr/local/bin/perl

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

do { print <<EOF; exit(0) } unless (&find_form_args ('', 'fields'));
Content-type: text/html

<title> Demo form </title>
<h1> Demo form </h1>

This is a demo form.  It's imbedded in the script (which would make
more sense if it were dynamically generated).  You can: <p>

<form method=POST>
Type some text:  <input name=small-text size=40> <br>
Type a lot of text: <textarea name=big-text rows=8 cols=40></textarea> <br>
Check the checkbox (or not): <input type=checkbox name=the-checkbox> <br>
and so forth... <p>
Finally, push <input type=submit value=this> button to submit the form.
</form>
EOF

# We got args.  Say what they were...

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

You submitted: <pre>
EOF

while (($var, $val) = each %fields)
{
  print &HTMLize("$var = $val\n");
}

print "</pre>\n";

