Forum Moderators: coopster
Declarations on the originating form
_______________________________________
// Get the user's input from the form
$CFNAME = $_SESSION['CFNAME'];
$CLNAME = $_SESSION['CLNAME'];
// Register session key with the value
$_SESSION['LNADV'] = $LNADV;
$_SESSION['FNADV'] = $FNADV;
_______________________________________
The fields and declarations on the receiving form
_____________________________________________
<INPUT name="CFNAME" type="text" value="<? echo $_SESSION['CFNAME'];?>" size="17"></td>
<td width="200" height="25" colspan="5"><input name="CLNAME" type="text" value="<? echo $_SESSION['CLNAME'];?>" size="17"></td>
// Get the user's input from the form
$CFNAME = $_POST['CFNAME'];
$CLNAME = $_POST['CLNAME'];
$CHILDREN = $_SESSION['CHILDREN'];
$ADULTS = $_SESSION['ADULTS'];
$CASENUM= (isset($_POST['CASENUM']))? $_POST['CASENUM'] : '';
// Register session key with the value
$_SESSION['CFNAME'] = $CFNAME;
$_SESSION['CLNAME'] = $CLNAME;
$_SESSION['CHILDREN'] = $CHILDREN;
$_SESSION['ADULTS'] = $ADULTS;
$_SESSION['CASENUM'] = $_POST['CASENUM'];
?>
First you get $cfname from $_SESSION, then you get it from $_POST then you write it to $_SESSION. Let's call it 1), 2) and 3).
So when you submit the data cfname = "bla" is in the form and you post it. 1) is null, but 2) is "bla", you pass "bla" into 3).
Next you click save, which is not form:
1) you get "bla", 2) you erase "bla" and have null, 3) you write null to $_SESSION.
The solution to this problem would be using function isset
if(isset($_POST["cfname"])) $cfname = $_POST["cfname"];
That should do!
Michal Cibor