Hi all.
I’ve a form that posts to another page. That page turns all the POST variables into SESSION variables (as well as cleans them for MySQL insertion):
[code=php] foreach ($_POST as $k=>$v) {
$v = field_sanitize_basic($v);
$_SESSION[‘form_data’][$k] = $v;
$_SESSION[$k] = $v;
$_POST[$k] = $v;
}
When I print all the session variables on that receiving page, there they are:
[code=php]foreach($_SESSION as $key=>$value)
{
print $key.” = “.$value.”<br>”;
unset($value);
}
[code=html]form_data = Array
submit = Submit Changes >>
logged_in = 1
user_role = 102
user_id = 1
user_username = lwatts
last_hit = 2011-06-20 13:36:12
txt_sudiv_geninfo = <p>This is a test of textfield 1.</p>
txt_sudiv_notes = <p>This is a test of textfield 2.</p>
txt_sudiv_events =
txt_sudiv_news =
txt_sudiv_recog =
txt_sudiv_roster =
But when I go BACK to the previous, form page, when I list the SESSIONS (same print script as above), the SESSION variables for the form don’t show up:
[code=html]form_data = Array
submit = Select SU
logged_in = 1
user_role = 102
user_id = 1
user_username = lwatts
last_hit = 2011-06-20 13:36:12
sel_suinfo = 703
Why in the world would this be? The SESSION is staying active, obviously by the persistence of the other variables like “user_role,” but just the SESSIONs that are part of the POST just go away.
Any ideas for what I need to look into, I would greatly appreciate it!
Thanks,
Liam