Use sessions
<?php
session_start();
// your fomrfields
$post_fields = array( 'key_one', 'key_two', 'key_three' );
$form_data = array();
// copy needed form data from $_POST array
foreach ( $post_fields as $key )
if ( isset( $_POST[$key] )
$form_data[$key] = $_POST[$key];
// save your form data in a session if no form data was saved before
if (
! empty( $form_data )
&&
! isset( $_SESSION['form_data'] )
)
$_SESSION['form_data'] = serialize( $form_data );
// read saved form data from session
if (
isset( $_SESSION['form_data'] )
&&
! empty( $_SESSION['form_data'] )
&&
empty( $form_data )
)
$form_data = unserialize( $_SESSION['form_data'] );
From now on use $form_data[key]
instead of $_POST[key]
Related Posts:
- Problem: ( kriesi ) pagination doesn’t work in homepage [duplicate]
- Custom Page Template for “Older Posts” Pages
- Next & Previous (Pagination in this case) Not Appearing
- Pagination stopped working after assigning custom page template to new page (different slug)
- Adding pagination on template page wordpress
- How do I make my pagination work?
- Show content based on page number
- Customizing Latest Post Pagination
- Page navi for template page
- Pagination is not working in custom page template
- get_posts custom paging
- Only show pagination when post count exceeds show post
- Split a long form into multiple pages
- pagenavi shows a lot of pages calculated from all posts in the site with query_posts
- Separate page for pagination possible?
- Reactjs – Form input validation
- Changing pagination list class
- Pagination resolving to first page only
- Pagination of RSS2 feed
- Modifying WP_LIST_AUTHOR Functions to output all users in a grid (and Paginate)
- How to ignore or disable nextpage tag?
- category/category_name pagination 404 error
- get_query_var(‘paged’) giving same result
- Show content only on front page?
- Confused on AJAX submit form through page template
- Getting 404 on taxonomy page
- Why am I getting a 404 on anything past page 1 of my query?
- Getting pagination for second loop to work on single.php
- Pagination difficulty using custom query in genesis-based custom theme
- 5 posts per page from single category, paginated
- WordPress custom URLs for pagination pages
- Home page not obeying post per page setting on the first page only
- How to add pagination to a single post
- Get Pagination (WP-PageNavi) not to work
- WordPress rewrite rules for pagination on search page
- Styling the_posts_pagination With Font Awesome
- Pagination on 2nd loop
- Problem with parameters in url and pagination
- How can I show a multipage post as a single, wrapped post?
- Why does pagination go to a blank page when navigating through home.php?
- Pagination with $_POST and $_SESSION
- wordpress is converting ?page=2 into /2
- Template hierarchy about pagination after front-page.php
- Add pagination to my custom loop [duplicate]
- Pagination with WordPress default gallery?
- How do i improve my custom pagination?
- Post Pagination Customization (wp_link_pages) Editing Navigation
- Default pagination is broken when use ‘static page’ as ‘front page’
- Paginate results from data fetched through array
- make a pagination that show posts by date
- Pagination on custom post type not working if permalinks set to rewrite url
- Theme Option not Working Inside a Function
- search with pagination not working as expected
- Cannot go back to the first paginated page using pagination links
- Validating custom fields before post save
- How to use pagination?
- How to get category/tag in URL for Pagination links?
- Include a leading zero in pagination
- Pagination not work on page but work on category
- Custom category.php paging shows the same posts
- Using $wpdb | checking entered email against existing emails in db
- Pagination Links showing incorrect previous page number
- How to limit page pagination… again
- Conditional pagination li’s
- Custom form not showing in correct place on page
- Paginate Links – Mid Size Less Than 2
- Different page template for paginated content?
- tax_query does not work with pagination with custom query (both wp_query and query_posts())
- Adding a single text input field to a custom Dashboard widget
- Pagination for multiple queries merging into one Loop
- paginate_comments_links() not working
- Adding paging to get_posts()
- Can I paginate this get_attachment query?
- Contact form – problem with displaying message about sent mail
- How to Show Next-Previous Link Only
- WordPress static home page pagination not working
- How to create a WordPress gallery with pagination
- Broken pagination links on WP 4.9.10 blog pages
- Back button not working after input / search submit
- Excluding posts without affecting the number of posts per page
- get_next_posts_page_link adds Inexistent directories
- why pagination not working in page template
- Pagination – linking back to base page – Page 1
- Custom Pagination shows same posts on each page
- Numbered pagination showing all numbers instead of paginated blocks
- Show next and previous page number
- Plugin option for input box validation
- Search pagination link redirecting to a link that doesn’t work with pagination
- Adding pagination to query for custom page
- Main page paginate_links issue
- Removing template part when not on homepage if / else
- Paginate template name
- Create a new page for each form selection
- How to reduce the number of pages in pagination
- foreach pagination
- paged query leads to 404? [duplicate]
- Pagination only working on index page not on a template page
- How to change `page` slug in pagination? on a specific pagination result (not globally)
- Two pagination in one page without being synchronous
- Change “/” (slash) before page number in pagination path to “-” (hyphen)