#!/usr/bin/perl
# ODBC/Perl Example One
# Takes input from a textbox, and gives it back to the user.
# Written by : Zack Steinkamp, 9 May 1997

# Standard Perl CGI library                                                    
use CGI qw/:standard/;

# Print HTTP Header
print header;

#Check to see if the form is filled out
if (param()) {
    &displayResults;
} else {
    &displayForm;
}
exit(0);

sub displayResults
{
    my $nm=em(param('name'));
print <<END_OF_PRINT
<html>
  <title>Example One Results</title>
  <body bgcolor="#FFFFFF">
    <font face="Arial" size=4>
      You entered $nm in the textbox.
    </font><p>
  </body>
</html>
END_OF_PRINT
}

sub displayForm
{
print <<END_OF_PRINT
<html>
  <title>Example Number One</title>
  <body bgcolor="#FFFFFF">
    <p><font size="4" face="Arial">
        <strong>Example Number One</strong>
    </font></p>
    <p><font face="Arial">
       Please enter some text, then click the Submit button...
    </font></p>
    <form action="../../../Copy%20of%20Spring2006/icom4036/sources/example2.pl" method="GET">
      <p><input type="text" size="20" name="name">
      <input type="submit" name="B1" value="Submit"></p>
    </form>
  </body>
</html>
END_OF_PRINT
}