Every time a refresh is refreshed, a write operation is performed. what should I do? At last, this post was edited by u010676349 from 2013-05-1507: 16: 07 in my php program. The user has a content to submit the form. after the user submits the form, write it to the database: if ($ _ POST [wb]) {mysql_query (insert & nbsp; into & nbsp ;......., & every time a refresh is refreshed, a write operation is performed. what should I do?
This post was last edited by u010676349 at 07:16:07
My php program is like this: the user has a content to submit the form. after the user submits the form, write it to the database:
If ($ _ POST [wb])
{
Mysql_query ("insert ....... ", $ Connect );
$ _ POST [wb] = "";
}
I mean: when $ _ POST [wb] is not empty, it indicates that the user submitted the form and writes it to the database. However, when I tried it myself, after submitting the form, yes, but it will be written again after the page is refreshed. Every time the page is refreshed, a write operation is performed. what should I do?
(Even if I use $ _ POST [wb] = "" after the write operation, this variable cannot be cleared. refresh the variable and write it again ).
Share:
------ Solution --------------------
I don't quite understand what the landlord means. Didn't the poster use the form's submit to submit it?
Since the button can be submitted, how does the landlord refresh it? On which page does it refresh?
The landlord can put the php processing statement in a php file separately, as long as the form action points to this file.
It will be complicated to accept post and submit post on the same page.
------ Solution --------------------
After submission, add a header to jump to other pages, so you are not afraid to refresh the page.