Danny's Simplest Form

If you create a HTML document like this:


<FORM ACTION="http:/cgi-bin/simple.cgi" METHOD="POST">
<P><B>Your Name : </B><BR>
<INPUT NAME="name" SIZE="50" MAXLENGTH="50"><BR>
<p><INPUT type="submit" value="submit" >

You would get a form like this:

Your Name :


When you press submit the script identified by ACTION is called. Here it is simple.pl, a short perl program that takes the data from the name field. The cgi_handlers.pl parse the data into an array called $rqpairs, with name accessed by $rqpairs{'name'}.


#!/usr/bin/perl 
# Version 1.00
use CGI ;
my $q = CGI-> new ;
# process form variables.
@values = $q -> param('name') ;
print $q -> header("Simple Reply") ;
print "Thank You:  @values \n";
 
------

Which would give you the output below:

Or, try out the form. It works.

Simple Reply

Thank You: Your-Name!


Have a Question or Suggestion? Drop Me An Email And Tell Me!

Back to Danny's CGI Page

Sponsored by Postino Dotcom