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.cgi, 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 
require 'cgi_handlers.pl' ;
&get_request();
&html_header("Simple Reply");
print "Thank You ", $rqpairs{'name'},"!";
&html_trailer();

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