There are many simple methods to prevent repeated data insertion from refreshing webpages. let's provide several reference solutions. How to prevent data from refreshing webpages: I made a message
There are many simple methods to prevent repeated data insertion from refreshing webpages. let's provide several reference solutions.
How to prevent data insertion from refreshing webpages:
I made a message board, but information will be inserted every time I refresh it. what can I do to prevent refreshing and inserting data?
JS returns after each operation
- $ Regs = mysql_query ($ shouruinsert, $ conn );
- If ($ regs) echo "script window. alert (" Operation successful "success"; script ";
- }
- Else {
- Echo "script window. alert (" Operation failed "); script please check whether the data you submitted is standard or contact the administrator !! ";}
- You can generate a cookie on the published page. on the submitted page, if the cookie is successfully submitted, the cookie is cleared. you can determine whether the cookie exists during the refreshing process.
- Another way is to directly judge the database after querying it,
- If ($ regs ){
- Die ('is exisit ');
- } Else {
- Mysql _.....
- }