| ★ wanayoo — archive 1999 http://www.devshed.com/Talk/Forums/Forum6/HTML/000246.html | Nouvelle recherche | Portail wanayoo |
|
|
DevShed Discussion Forums
![]() Perl
![]() serious Problem with one Click!
|
| next newest topic | next oldest topic |
| Author | Topic: serious Problem with one Click! |
|
chinnavi Member |
I face serious problem with MySQL and PERL DBI ... The Thing is i have one button in my form that calls one CGI .. The CGI will do the function that will insert the values of the form into a Table. "The Serious Problem" is this function inserts again and again when i click "Reset" button ... i startled when i see the table values ...that i inserted twice anybody having idea ?
|
|
Shiju Rajan Member |
"The Serious Problem" is this function inserts again and again when i click "Reset" button ... make sure that your reset button is not.. it should be: ------------------ "The fear of the LORD is the beginning of knowledge..." |
|
chinnavi Member |
Sorry ! If i press "Reload" button in the Browser The CGI program is executing again and inserting values into table again (in the MySQL DB).. What should i do ? vijay |
|
herou Junior Member |
You have to redirect to another page when the values have been inserted. Do not let your .cgi output any HTML code! In Detail: The only output of your .cgi, that really means the one and only use of the 'print' function must appear at the end of your script, namely a line like this: print "Location: http://www.yoursite.com/thankyou.htm\n\n"; This promptly redirects the client to another page and he cannot mess up your database by hitting 'reload' any more. |
|
Shiju Rajan Member |
vijay, you can tackle this problem.. i don't know wether you are receiving any unique value from form(user) to your database(ie, field like "username" --it will be unique for each and every user).so you can issue a select command before inserting new record into the database.
if that record is exist then show him a message "Record is already exising in the database"...
-----
"The fear of the LORD is the beginning of knowledge..." [This message has been edited by Shiju Rajan (edited July 06, 2000).] |
|
chinnavi Member |
Thank you , "Checking the form values before inserting" is very good idea. But what about redirecting a page another Location will work... Actually I want to insert into table before proceeding to another page ...This also seems to be a good idea.Because it will reload from that page alone.... I am now working on validating the user inputs before inserting into table along with redirecting to another page ... There is still one more thing is there to thing ... I tested the Back button and it displays all the Form values .. Now if User submits ... The data will be inserted into table.. This Problem is still there in Devshed. See my Double Submission in MySQL Forum ... B'cause sometime internet speed become slow ...
vijay |
All times are MST (US) | next newest topic | next oldest topic |
![]() |
|
Copyright © 1997-2000 ngenuity. All rights reserved.
Powered by: Ultimate Bulletin Board, Version 5.41a
© Infopop Corporation (formerly Madrona Park, Inc.), 1998 - 1999.