Roger Ramjet,
Thank you for your post, it made me check my code and I found that I had done the following when I posted the values to the session variables:
function next_page()
{
$_SESSION['answer'][age] = $_POST['age'];
$_SESSION['answer'][los] = $_POST['los'];
$_SESSION['answer'][eecat] = $_POST['eecat'];
$_SESSION['answer'][division] = $_POST['division'];
$_SESSION['answer'][dept] = $_POST['dept'];
$_SESSION['answer'][section] = $_POST['section'];
header("Location:page1.php");
}
which i then amended to:
function next_page()
{
$_SESSION['answer']['age'] = $_POST['age'];
$_SESSION['answer']['los'] = $_POST['los'];
$_SESSION['answer']['eecat'] = $_POST['eecat'];
$_SESSION['answer']['division'] = $_POST['division'];
$_SESSION['answer']['dept'] = $_POST['dept'];
$_SESSION['answer']['section'] = $_POST['section'];
header("Location:page1.php");
}
also amended all my code. Thanks for pointing that out!
stolzboy,
Thanks for your reply!
Yes, I've tried that and I got a parse error saying that there was an unexpected '{'
So it still doesn't work.
Here's my code to assign the variables:
function var_value()
{
$age=$_SESSION['answer']['age'];
$los=$_SESSION['answer']['los'];
$eecat=$_SESSION['answer']['eecat'];
$division=$_SESSION['answer']['division'];
$dept=$_SESSION['answer']['dept'];
$section=$_SESSION['answer']['section'];
}
And this is how I checked to see if they worked:
function display_var()
{
echo $_SESSION['answer']['age'];
echo "<br>";
echo $age;
echo "<br>";
echo $_SESSION['answer']['los'];
echo "<br>";
echo $los;
echo "<br>";
echo $_SESSION['answer']['eecat'];
echo "<br>";
echo $eecat;
echo "<br>";
echo $_SESSION['answer']['division'];
echo "<br>";
echo $division;
echo "<br>";
echo $_SESSION['answer']['dept'];
}
function submit_form()
{
var_value();
display_var();
}
The value of the session variable is displayed while the other is just a blank line.
Thanks again for all your help!