There are very few ways to maintain variables between pages. An alternative is to have a separate form on the second page with hidden text fields containing $ _POST data, and the submit button calls up the previous page. It is impossible to bypass the "back button" in the browser, unfortunately.
I missed the bold text about session variables - ignore it if not applicable:
one way to store variables on server-side pages is to use $ _SESSION
first include the following at the top of your PHP pages to keep the session active:
session_start();
after submitting the application and going to page 2, add the following:
$_SESSION['customer_name'] = $_POST['customer_name'];
In addition, on the first page, you can change the form element as such:
<input type="text" name="customer_name" value="<?PHP if isset($_SESSION['customer_name'] || !empty($_SESSION['customer_name'])) { echo $_SESSION['customer_name']; } ?>">
this will save the completed data and display it when the user returns the whole page, and if they add something else, it will be updated when they return to page 2.
Silvertiger
source share