Every time a refresh is refreshed, a write operation is performed. how can this problem be solved?

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.