Your code does not even compile. There is no ->text_field method in CGI, and you're mixing object- and non-object calls to CGI.
Take a look at the generated HTML and you will find that $cgi->hidden(...) does not output the HTML. You will need to print it out like in the rest of your code.
use strict; use CGI; my $cgi = CGI->new; my $host = $cgi->param('host'); print "<font color=green> Please Enter the UserID for $host: </font>"; print $cgi->textfield('USER','',10); print "\t\t".$cgi->submit('action','Submit'); print $cgi->hidden( -name=>'server', -value => $cgi->param('host')); if ($cgi->param()) { my $test= $cgi->param('action'); if( $cgi->param('action') eq 'Submit') { my $server = $cgi->param('server'); print "Server is $server\n"; }; }; __END__ >perl -w tmp.pl host=foo Use of uninitialized value in string eq at tmp.pl line 13. <font color=green> Please Enter the UserID for foo: </font><input type +="text" na me="USER" size="10" /> <input type="submit" name="action" val +ue="Submit " /><input type="hidden" name="server" value="foo" />
In reply to Re^5: Getting Variable value after submitting cgi form
by Corion
in thread Getting Variable value after submitting cgi form
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |