gayu_justin has asked for the wisdom of the Perl Monks concerning the following question:
helo, my problem is that, i have a form using in a template file and action to a cgi page.But whenever i refresh the page, the the entered values are getting inserted again.How can i prevent this ????
Following is the code using in the template file.following is the code in the cgi page.<body > <form name="group" method="post" action="process.cgi"> <div id="mainContainer"> <div><label>Group name : </label><input type= +"text" name= "group_save0"> <label>Group description : </label><input typ +e="text" name= "group_save1"> </div> </div> <div><input type = "submit" name ="firstsave" +value = "Save"></div> </form> </body>
if ($grupsave1 ne '') { if ($grupsave1 =~ /^([-\@\w\s.]+)$/) { $grupsave1 = $1; print $grupsave1; } else { die "Bad data for group name('$grupsave1') in group"; } if ($grupsave2 =~ /^([-\@\w\s.]+)$/) { $grupsave2 = $1; print $grupsave2; } else { die "Bad data for group description('$grupsave2') in g +roup"; } my $grupsave_insert = $dbh->do (q{INSERT INTO group_management (group_ +name,group_description,isactive) VALUES (?,?,?)}, undef, ($grupsave1, +$grupsave2,'y')); } else { }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: How to prevent a Reload from resubmitting a form?
by rjt (Curate) on Jul 08, 2013 at 11:14 UTC | |
Re: How to prevent a Reload from resubmitting a form?
by Ralesk (Pilgrim) on Jul 08, 2013 at 11:20 UTC | |
Re: How to prevent a Reload from resubmitting a form? (P/R/G)
by Anonymous Monk on Jul 08, 2013 at 11:25 UTC | |
Re: How to prevent a Reload from resubmitting a form?
by sundialsvc4 (Abbot) on Jul 08, 2013 at 14:13 UTC |
Back to
Seekers of Perl Wisdom