|
|
|
|
Joined: Apr 2003
Posts: 6
Lurker
|
|
Lurker
Joined: Apr 2003
Posts: 6 |
I have a HTML form that calls a PHP script to enter data into a MySQL DB then displays the info to the page. However, it is human natuire for a person to REFRESH the page and this is re-submitting the data causing multiple entries. I tried adding
mysql_close();
at the end of the PHP script that is called from the HTML form but this isnt working. Would I add the mysql_close() function at the end of the HTML form to stop this?
michael
|
|
|
|
|
Joined: May 1999
Posts: 1,715
Addict
|
|
Addict
Joined: May 1999
Posts: 1,715 |
When the user hits refresh a new instance of the script is run and therefore you can't use something like that in the script.
You have to do something similar to what threads does, check if the data posted is already in the database and if so just inform the user that the info is already inserted.
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
Posts: 1,153
Joined: July 2001
|
|
|
Forums63
Topics37,583
Posts293,955
Members13,824
| |
Most Online151,614 Nov 14th, 2025
|
|
Currently Online 646
Topics Created 0
Posts Made 0
Users Online 0
Birthdays 22
|
|
|
|
|
|