At the start of the page, I have this:
Code: Select all
ob_start();
require(INCLUDES . 'header.php');
// Remove slashes and white space
$_POST = cleanVars($_POST);
session_start();
foreach ($_POST as $key => $val) {
$_SESSION[$key] = $val;
}
ob_end_flush();Is this a problem related to the fact that each step of the form is not a separate file? I didn't think it would make a difference if the form is submitting to itself or a new page.
----------------------------------------------------------------------------------------------------------------
It might be easier for someone to start explaining from the beginning, and ignore what I've done so far. So here is what I'm trying to do:
- When the order form is started, session starts.
- If the user goes backwards or forwards through the 4 steps, data needs to appear again in the fields of previously visited pages.
- When the order is finalised on the last step, they see a confirmation screen (we're still on the same page as before). At this point, the session should be destroyed so if they refresh the confirmation page or return to the order page again, it will start a new order.