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:
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>