, , ,

How to hamper the “Confirm form resubmission” dialog box on the localhost PHP file?

Posted by

Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps!

We spend hours scrolling social media and waste money on things we forget, but won’t spend 30 minutes a day earning certifications that can change our lives.
Master in DevOps, SRE, DevSecOps & MLOps by DevOps School!

Learn from Guru Rajesh Kumar and double your salary in just one year.


Get Started Now!

Suppose, you’re doing crud operations through PHP and inserting certain sorts of data into the database through a localhost PHP file. And you find the Confirm form resubmission dialog box at the apex of the PHP page. You will find like below-mentioned image which I have mentioned besides below:

Confirm Form Resubmission Dialog Box

If you will apply the below-mentioned code in your PHP file under the javascript code then you will get rid of all duplicate data from your localhost PHP page and it works in my PHP code. I’m sure, it will really work on your PHP code.

 <script>
          if ( window.history.replaceState ) {
         window.history.replaceState( null, null, window.location.href );
          }
        </script>
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x