I have a form that leads to a success page that uses $_SESSION['form_data'] variables to populate the success page.
E.g.
<?php
session_start();
$name = $_SESSION['form_data']['element_1_2'];
echo "Welcome " . $name;
?>
But it doesn't work form the start. The success page doesn't show any of the $_SESSION['form_data'] variables.
However, if I hit the back button and resubmit the form data then the success page is populated correctly.
Please help resolve this issue.
Here's the code I have for the php-functions.php file:
//if there is any error message or elements, send false as status
if(empty($error_elements) && empty($process_result['custom_error'])){
$process_result['status'] = true;
//Store form variables in session variables
$_SESSION['is_valid_user'] = true;
$_SESSION['form_data'] = $table_data;
$_SESSION['form_data']['id'] = $record_insert_id;
//if 'form review' enabled, send review_id
if(!empty($form_review)){
$process_result['review_id'] = $record_insert_id;
}
}else{
$process_result['status'] = false;
}
return $process_result;
}
I can privately email my form and success pages with code and links if needed.
Thanks!
Mike
