Question : learning cgi with html variables

Experts,
I am "trying" to learn how to write a script where I take information from an htlm file and using cgi output the values I entered.
Here's my html (very basic)


Using Forms


pl" method="get">
Please enter your first value




Please enter your last value








Here my cgi:
#!/usr/bin/perl
print "Content-type: text/html\n\n";
$Values= ;
print $Values

print "$FORM_DATA{'valueone'}\n\n";
print "$FORM_DATA{'valuetwo'}
\n\n";

I get absolutely nothing. Please help - beginner - YES!

Answer : learning cgi with html variables

There are a couple of ways to do this.  There is a module called CGI.pm that makes working with perl and cgi a lot easier.  Here is how to use it to get values from a form.

Your form doesn't look right. Try this instead.

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
#!/usr/bin/perl
use CGI;
 
print "Content-type: text/html\n\n";
 
my $cgi = new CGI;
$value1 = $cgi->param('value1');
$value2 = $cgi->param('value2');
 
print "Value 1 is $value1 
Value 2 is $value2";
Open in New Window Select All
Random Solutions  
 
programming4us programming4us