| 1 |
#!/usr/bin/perl |
| 2 |
use strict; use warnings; |
| 3 |
use CGI; |
| 4 |
|
| 5 |
my $c = new CGI; |
| 6 |
|
| 7 |
if(defined($c->param("foo"))) { |
| 8 |
print $c->header, |
| 9 |
$c->start_html("Thanks for submitting the Foobar Form!"), |
| 10 |
$c->h1("Foobar Form Results"), |
| 11 |
"<hr />", |
| 12 |
"<strong>Foorbar Form Results: ", $c->param('foo'), "<br />", |
| 13 |
"Thanks for submitting!</strong>", |
| 14 |
$c->end_html(); |
| 15 |
} else { |
| 16 |
print $c->header, |
| 17 |
$c->start_html("It's the Foobar Form!"), |
| 18 |
'<form method="POST">', |
| 19 |
'<input type="text" name="foo" value="bar" /><br />', |
| 20 |
'<input type="submit" value="Submit the Foobar Form!" />', |
| 21 |
'</form>', |
| 22 |
$c->end_html(); |
| 23 |
} |