prevent re-submit in page reload
-
Hello , im trying to create a small plugin of booking ( custom post type : booking) and in my form when success submit it post it show the booking details to user, but if user reload the page it submit again ??
please how to resolve that that is my code of submit ( only header) :
`if ( ‘POST’ == $_SERVER[‘REQUEST_METHOD’] && ! empty( $_POST[‘action’] ) && $_POST[‘action’] == “new_post” ) {
// Do some minor form validation to make sure there is content
if(!empty($_POST[‘start’]) || !empty($_POST[‘end’])){ submit post and send email ) }}then if success : show booking details
Else show error and the form
i tried to unset($_POST[‘start’]) and $_POST[‘end’] to prevent resubmit if success but not working,
i have one idea but i really dont know how to do it , its to get the post type just submitted in one other page by user ( not logged).
Thank you in advance if you have any idea to help me
Regards
- The topic ‘prevent re-submit in page reload’ is closed to new replies.