Hi,
I notice that when I click the 'Back' button my previous script runs, i.e, all the php code runs (I previously thought that maybe the previous form displays without the code re-running).
However, I do not get the expected value displayed on my form.
After populating one element in formA with '17' (just any number) and submitting to formB (using POST ---> Redirect --> GET to avoid the 'expired from cache' message) I then click the 'Back' button and the 17 does not appear.
In the code below, after clickng 'Back', I see as output from the echo statement that rb_value[0] is, infact, '17' but within the form, the text element named rb_value[0] displays as empty.
Does anyone have suggestions why this might be?
It might have to do with that I do not understand what the 'back' button does. Or maybe with my PRG (post - redirect - get) model.
Thanks.
Here is part of the code:
echo "rb_value[0]=".$rb_value[0]; //After clicking 'Back' I see that rb_value[0] is 17
if (isset($rb_value[0])) {
$rb_val = $rb_value[0];
} else {
$rb_val = 1;
}
$line.= "<td width=\"20%\" valign=\"center\" align=\"left\"> ";
// This element displays as empty instead of the expected 17
$line.= "<input type=text name=\"rb_value[0]\" value=\"$rb_val\" size=\"25\" maxlength=25 </center> "
$line.= "</td> ";