rupesh has asked for the wisdom of the Perl Monks concerning the following question:
The cgi perl script would take the input from the page, validate and enter the details to a text file.<html> <head> <meta http-equiv="Content-Type" content="text/html"> <title>Application</title> <Form method=post name="myForm" action="cgi-bin/details.pl"> ... ... ... <select size="1" name="application" style="font-family: Verdana; font- +size: 13px; border: 1px solid #000000; padding: 1; " size="6" maxleng +th="6" style="background:#D7DFEE;color:blue"> <option></option> <option value="CIDAccounts">CIDAccounts</option> <option value="Column_Financial">Column Financial</option> <option value="IFA">IFA</option> <option value="Imaging-Fax">Imaging-Fax</option> ... ... ... </Form> </body> </html>
The issue Im facing is that if the user hits refresh in the page which is loaded by the cgi, and hits retry when prompted, the details are again written to the text file.#!c:\perl\bin\perl use strict; use CGI qw(:standard); my $okflag="y"; my @chk; my @InvalidFields = grep {not defined CGI::param($_) or CGI::param($_ +) eq ''} CGI::param(); ... ... ... my @ppl=param('coord'); my $reldate=param('date'); my $apps=param('application'); .. open FH, ">>report_sum.txt" or die "Cant open report_sum.txt Reason: $ +!"; print header; print start_html('Thank you'); print <<EOF; my $writestr=<a single string concatenated based on all the values> print FH $writestr."\n"; close FH; print end_html;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: CGI Cookie
by ajdelore (Pilgrim) on Sep 05, 2003 at 17:24 UTC | |
by rupesh (Hermit) on Sep 08, 2003 at 06:51 UTC | |
Re: CGI Cookie
by bradcathey (Prior) on Sep 05, 2003 at 18:04 UTC | |
Re: CGI Cookie
by freddo411 (Chaplain) on Sep 05, 2003 at 22:20 UTC |