javascript - Stop script execution after refresh -


i wrote single program using html , javascript contains submit button. problem have when refresh page, it's pressed submit button again!! want not execut script if refresh page. don't know if it's clear it's want program intialized if refresh page instead of executing previous script !

i believe referring browser behaviour when submit form same page, if refresh prompt resubmit data again.

you can avoid issuing redirect @ end of script, refresh page , clear history of submit.

if (isset($_post['submit'])) {      // ... code here      header('location: ' . $_server['php_self']); } 

Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -