|
Posted by Rik on 05/30/06 11:18
Ian Davies wrote:
> hi jerry
> the data is in a session, and it retains itself during the first form
> post. however I cannot get it to remain when the second form posts,
> even though the sessions are still true and the textbox and
> radiobuttons values are are still set to the session. I think it has
> to do with the second form somehow. it seems that it is influencing
> the textbox and radiobutton's values. but i cant work out why
> ian
I suspect the problem is this:
$_SESSION['pupilfield'] = trim($_POST['pupilfield']);
$_SESSION['gender'] = trim($_POST['gender']);
After the second form, this $_POST values are non-existent, so null, and
hence $_SESSION[key] get's set to null.
Use:
$_SESSION[key] = (isset($_POST[key])) ? trim($_POST[key]) : $_SESSION[key];
Grtz,
--
Rik Wasmus
Navigation:
[Reply to this message]
|