#! /usr/bin/perl

use CGI ':standard';
use CGI::Carp "fatalsToBrowser";

# W. Sterner CS101   -- Homework 5, problem 2a

#2. Hidden Fields (25 pts.) 
#
#Create a cgi script that uses a hidden form field to pass user-supplied
#data across html pages. 
#
#The user should be presented with an HTML form page with a field to enter
#a name and submit button.  On submit, another form page must be called
#up to enter more data of your choice.  A text input field and a submit 
#button would suffice. This form page must contain the name entered into 
#the previous form as a hidden field.  The submit button shall call up a 
#third page that will display the data entered in both form pages, including 
#the name.
#The first page may be a static HTML page, the others must be created 
#dynamically by cgi-script(s). 

    print header, start_html('Using Hidden Fields to pass User Data');
print br;

print '<form action="http://people.cs.uchicago.edu/~sterner/cs101/testpl/pg52b.pl" me\
thod="post">';




print br, 'Please type in your name  ';
print br;

print '<input type="text" size="15" maxlength="20" name="name">';

print br, '<input type="hidden" name="STATE" value="GOT_NAME">';
print br, '<input type=submit value="Submit Name">';
print '<input type=reset value="Erase and Restart">';
print '</form>', end_html;
