#!/usr/bin/perl use CGI; $q = new CGI; print $q->header; if ($q->param()) { print $q->start_html("Results"); print $q->h2("Results"); print "Here's what you entered:
\n"; print "Your Name: ", $q->param("name"),$q->br; print "Email: ", $q->param("email"),$q->br; print "Age: ", $q->param("age"),$q->br; print "Favorite Color: ", $q->param("favorite_color"),$q->br; } else { $q->start_html("Post Form"); } print $q->start_form(-action=>"formmod4.cgi"); print "
\n"; print " Your Name: ",$q->textfield(-name=>"name"), "\n"; print " Email address: ",$q->textfield(-name=>"email"), "\n"; print " Age: ", $q->textfield(-name=>"age"), "\n"; print "Favorite Color: ",$q->textfield(-name=>"favorite_color"), "\n"; print "\n"; print $q->submit(-value=>"Send"), $q->reset(-value=>"Clear Form"); $q->end_form; $q->end_html;