To redirect to some other page, you can use wp_safe_redirect
any time before you echo content to the browser, including HTTP headers, which, I think, answers your question. But I would just echo
a message on the same page if it were me.
Not really on topic, but there are a number of things about that template that do not look right. I can’t find get_header
or get_footer
, for example. And you are trusting all kinds of user supplied data. Plus, that page will trigger a string of Notice
s if $_POST
is not set. Enable debugging to see what I mean.
Related Posts:
- What is & used for
- How to include landing page with form submission?
- How to edit a user profile on the front end?
- Is wp_nonce_field vulnerable if you know the action name?
- How to submit data from HTML form?
- Autocomplete for taxonomy input boxes on a front end form
- how to handle forms in multiple pages?
- set_query_var doesn’t seem to work on init hook
- How to send multipart form data to WordPress endpoint
- Placeholders in Jetpack Contact Form [closed]
- $_POST empty on submit (same code, same form submits normally on local server)
- Gravity Forms skip form if already filled out using cookie?
- Loading scripts & styles from a meta box callback function
- Looking for a simple approach for handling user $_POST data without AJAX?
- How to return variables from admin-post.php
- Setting specific image size for specific form upload file field
- Get data from dropdown and update page
- How to Process Form Request
- Return to option page after running PHP script
- limit characters when posting from form
- Adding data to an array in usermeta and displaying it in a loop
- Help with forms and nonces
- How to redirect new WordPress user to previous page after registering
- WPForm, how to set date to tomorrow
- php form create 2 posts
- Create form on plugin options page that creates submenu pages for that plugin
- Contact Form 7 – Add a Info Text to Checkboxes/Radiobuttons [closed]
- How to make WordPress forms secure (HTTPS)
- Can you have more than one nonce on a page?
- Post submit using shortcode and init
- Password protected page with a form submits for me fine but for others redirects them back to the password prompt
- How dynamically change wp_mail behaviour, sending html or plain text based on conditions?
- What form element names break wordpress?
- Remove field in the form : only works for “url”, not for “email”?
- I am trying to grab the title and put it in a paypal form select option
- How to add required fields in user profile admin page?
- Java code/ JSP page in wordpress
- Should I use wp_nonce_field on my contact form?
- how to add a custom form in a page
- Form Submission Warning: Cannot modify header error only when plugin is deactivated
- Programmatically populate form fields with data
- advanced custom fields and contact form 7
- Stop SPAM from custom form
- Sort populated GravityForms list alphabetically [closed]
- Complex Timesheet Form
- Custom tables and using wpdb to insert into DB from a html form
- Send value of PHP variable in template via hidden field in a form
- Saved emails at dashboard
- Fatal error: Call to undefined function wp_insert_post()
- WordPress Frontend Post Form (Bootstrap Modal) Not Creating Post
- How to use HubSpot Forms API in WordPress pages?
- Inquiry form like on URL [closed]
- Headers already sent on a frontend post form using wp_redirect before get_header
- Contact form with Jquery and PHP don’t work
- Email from my theme’s contact form doesn’t get the reply-to address right
- Can I have two submit buttons in one form? [closed]
- how do i make the “contact us” on a page created not to display
- wordpress forms submit
- wordpress blog, is there a way to make anyone post in a blog without having login info
- Email form getting hacked
- sending form with time interval
- How to redirect a Link to a new tab in contact form 7?
- how do I hide or encrypt query strings for gravity forms
- Why is my contact form not working?
- Sorting wordpress data in excel
- Save and retrive data from a custom form to database
- Pricing depending on selected items in a multi step form
- WPAdverts – How to limit form submission 10 per month
- Using an iframe for a form help
- Sending Form data as Attachment
- Trigger action when submitting form with WPForms [closed]
- Fatal Error with WP Forms
- How to call or add password input / generate password / password strenght meter in custom registration form?
- Need to show results on the frontend of an admin form
- Form data being sent to parent directory
- fetch custom post if meta key exist
- Passing form data on submit
- Create a custom calculator in wordpress
- How to stopping auto scrolling after submitting the form?
- Preventing form resubmission on contact form plugin
- Plugin to get a result based on form checkbox
- How to handle dynamic form data with repeating fields?
- How to send form values from the script in functions.php and not from the form on my website?
- Passing input value into name of input
- wp_insert_post with POST data
- Issue with contact form 7
- Adding a “Report the post” button/form?
- wordpress not saving form code in code editor
- Create register form plus send post
- Auto populate a Form
- Submit button returns to index page instead of sending data
- Order form for WP (similar to a wishlist) [closed]
- How to manage to submit WPForms at our webpage
- Dynamic price for payment button
- Forms lead to “Page not found” in Ultimate Member plugin
- How to use tag in wordpress?
- How can I get lost form data back? [closed]
- Forminator + Hubspot Workflows
- How can I add email code authentication on form submission without any wp plugin?
- Implementing Autosave Functionality for Long, Multi-page Forms in WordPress