You could put both the form and processing logic in the same file and submit the form to the same page by omitting the action attribute. Check $_POST vars to see if the form has been submitted and do your processing, otherwise display the form.
if( isset( $_POST['somevar'] ) ) :
// process submission
else :
// show form
endif;
Related Posts:
- php – Plugin/theme relative PATH/URI
- wordpress admin part is not accesbile after server shifting
- Apply function.php filter only if url not has /amp/
- How to route root path / to /xyz in nginx?
- I can’t load my images from a js file using wp_localize_script
- Right path for renaming a file in uploads folder
- Is there a way to get a path to the theme directory without the server name?
- error_log() output for print_r() appearing on page
- Nginx FastCGI_Cache Vs PHP Caching
- Remove Woocommerce product link
- How to display multiple Post meta_key/meta_values by SQL query
- How To Customize Position of »add to cart« of WooCommerce on Product Page [closed]
- Sort posts from multiple sites by date
- Dynamically loaded Theme components based on Customizer Settings values : changes not appearing in Customizer preview – (Workaround found)
- Change Width of Featured Image Thumbnail on Add/Edit Post Page
- Create table in database when activating plugin
- Implement a multi-value input field where the number of entries is not limited
- How can I export post data in xml format?
- Getting my head round WordPress filter
- allow user to select pages from dropdown in my plugin
- Export WordPress Table to CSV from page
- How to set a custom path, for ajax image upload folder in admin?
- Recent post display using shortcode
- Can I use `.phtml` instead of `.php`
- WP_cron won’t trigger my action
- how to save selection meta data in user profile on frontend
- woocommerce registration form with klaviyo(don’t work with current user)
- How to get a list of all possible values of a specific user meta key?
- Use object in template part
- Can’t extend some core classes
- Create onClick Event to Re-load a Widget
- Output Buffering – Everything between wp_head and wp_print_footer_scripts?
- functions.php is being included twice, creating PHP fatal errors
- Hide Hamburger Menu On Specific Page (Front Page/Home Page)
- Accessing the database from a plugin outside of action hooks
- Menu Limitations
- selected option if current category is the value
- Custom query, checking values of multiple meta keys
- Search Query: how to construct a search string from two select elements?
- Genesis framework comments broken?
- Help solving t_echo php error while using echo do_shortcode
- How i can get post data from database when i am getting post id from url in wordpress
- Hook called before text widget save
- Mixing variables into an array when inserting values
- meta box not display data input in the textarea
- wpdb prepare insert table doesn’t work
- How to modify the default feed via a function
- dynamic page using php from sql database
- Loop over Array and get the distinct ids
- Store metakey value as an array
- How do I change this function from two returns to one string to show sku and dimensions in WooCommerce cart?
- Custom Post type slider with thumbnail navigation
- how to add re-order to wp user panel of wordpress?
- How to add new CSS file to new PHP file
- WordPress SQL JOIN query
- Aspx/Rss feed – failed to open stream: Redirection limit reached
- Adding an Unlinked Space in a Custom Function
- WP_Query and help with the loop for magazine front page
- Why does PHP called with Jquery AJAX not allow additional php code to be added?
- Infinite Loop in WordPress Installation
- send popup after wp_redirect()
- Validate search against a list of codes in wordpress
- Custom Post Status 404 URL
- Checkbox doesn’t save inside metabox
- Generating 10 000 WordPress posts using PHP and avoiding Server Timeout error
- A function to get the content of a page
- If Post Published Date or Modified Date is 1 Year or Older, Display Notice on Post Page
- Trying to create a shortcode to display categories with a specific product tag
- Using the get_template_part method within an mu-plugin not possible?
- Updating user meta adds string count to value?
- Woocommerce Product page add on checkbox and price
- Where Do Image Dimensions Get Added To A Filename?
- How to set Nav as a default menu in wordpress
- Sum All the Post Meta of Published posts of Current Logged in user
- Page template not working when logged out
- Add my footer menu to the header
- WordPress child theme, creating a custom php template page
- Child and Parent Pages list of sub pages
- WAMP SERVER Command Prompt SET PATH=%PATH%
- How to block access to a folder inside of wp-content for non logged in users?
- Ordering / grouping posts by datepicker ACF
- How to use get_template_part always relatively to the file I’m using it in?
- Only Get A Certain Number of Posts From WP_Query
- Need to adjust condition to say if I’m pulling categories from a post, to pull only the first one
- how to display child terms with parent terms in custom taxonomy?
- Even with PHP plugin get_posts not working in widget area
- how to add number value in front for variable [closed]
- Use custom get results query to show posts WordPress
- Execute php in pages
- echo variable containing html and the_permalink();
- Search in particular category in wordpress
- Problems With Query and/or Template Part and/or PHP
- Add Custom Post Type on the Fly or create an array
- WP Login Button for current domain
- Pull GET parameter from URL in functions.php
- How to NOT override inline css rules
- Adding Gravity Form With if(is_page) Is Not Working
- Implement “No related posts for this entry” into the loop?
- Twig+WordPress how to use array arguments inside a function?
- I would like to alert message while another user is editing or update data in wordpress admin panel, what should i do?