MrNobo1024 has asked for the wisdom of the Perl Monks concerning the following question:
Here is the code:
The first time this is run, it prints "Your number is 0" and the hidden field is set to 1, as expected. But when I click on the button and it calls count.cgi?number=1, it prints "Your number is 1" but the hidden field is again set to 1! Why isn't it going to 2?#!perl -Tw use CGI qw(:standard); use strict; my $num = param('number') || 0; print header, start_html; print "Your number is $num."; print start_form; print hidden('number', $num + 1); print submit('Get next number'); print end_form; print end_html;
--MrNobo1024
s]]HrLfbfe|EbBibmv]e|s}w}ciZx^RYhL}e^print
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Problem with CGI.pm generated forms
by Hero Zzyzzx (Curate) on Aug 14, 2002 at 01:21 UTC | |
(jeffa) Re: Problem with CGI.pm generated forms
by jeffa (Bishop) on Aug 14, 2002 at 01:16 UTC |
Back to
Seekers of Perl Wisdom