I want to validate a form, calling itself using the following code, then pass the form variables to another page. As you can see, I assign the values to session variables, however I am having problems with persistence of the session variables on the next page (the user can go back and forth between the form and the page called by the form).
Is there a way that I can redirect to rpt_template.php to pass the form variables without using sessions? I would ideally like to call rpt_template.php via a POST request in the re-direction so that the form calls itself, is validated, and then reposts itself to rpt_template.php.
if ( $submit )
{
$result = check_form ( $_POST['ip_address'], $_POST['report'], $_POST['report_option'], $_POST['report_spec_description'], $_POST['report_spec_name'] );
if ( $result[error] == false )
{
session_start();
$_SESSION['ip_address'] = $_POST['ip_address'];
$_SESSION['direction'] = $_POST['direction'];
$_SESSION['report'] = $_POST['report'];
$_SESSION['duration'] = $_POST['duration'];
$_SESSION['duration_number'] = $_POST['duration_number'];
$_SESSION['direction'] = $_POST['direction'];
$_SESSION['comments'] = $_POST['comments'];
$_SESSION['report_option'] = $_POST['report_option'];
$_SESSION['report_spec_name'] = $_POST['report_spec_name'];
$_SESSION['report_spec_description'] = $_POST['report_spec_description'];
header ( "location: rpt_template.php?type=Link" );
}
else
{
$mode = "error";
$error_message = $result[error_msg];
}
}
Thanks, in advance
Chris