Brian wrote:
I'm wondering if someone can do me an enormous favour and write a cgi for me please, I just can't get my head around the books I have, they might just as well be written in Klingon.

I would like to be able to enter a number into a form. (eg 1234)
This number would also be output to result.html which I will get to in a minute.

To read a value from a CGI form you need to use the module CGI, you can add it to your program like this:


 use CGI qw(:standard);


With this in place you can read the values, for example if the entry box on the form is called "number" you read it using this:

 $number = param ('number);


Now you have that in place, you can set your page up to display the number entry box
if there is no number or the results if there is one:



#!/usr/bin/perl

use CGI qw(:standard);
$number = param ('number);

if ($number ne undef) {

 #code for calculating the result

} else {

 #code for the html form.

}



Hope this helps you to get started.

 -Gav




--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to