Best way to avoid the submit due to a refresh of the page

Don’t show the response after your create action; redirect to another page after the action completes instead. If someone refreshes, they’re refreshing the GET requested page you redirected to.

// submit
// set success flash message (you are using a framework, right?)
header('Location: /path/to/record');
exit;

Leave a Comment