Thanks Rowsdower.
I accept that this is the correct way to do it. I thought there might be an easier way.
Problem is that I have to rewrite the script a fair bit because the variables are used to repopulate the form when necessary.
For example, I amended this function to include 'form_data' as a new level and now have an error on the echo line
- unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING.
PHP Code:
function restore_text( $_SESSION, $name, $control, $session_name )
{
if(isset($_SESSION['form_data'][$name])) {
if($control == $session_name ) {
echo "$_SESSION['form_data'][$name]";
}
}
}
From a security perspective, I still would not be able to destroy the session. Maybe this doesn't matter?
Cheers.