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.
<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>
following is the code in the cgi page.
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 { }

In reply to How to prevent a Reload from resubmitting a form? by gayu_justin

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.