Hello,
I have a strange problem. If I delete a value from array then the whole array becomes empty. Basically what I am doing is:
- I take inputs in input fields from user (input.php). I press submit.
- I display values in other page (display.php)
- I click back button on display.php (not the browser back button)
- I get the values back on input fields
- I change values in say 3rd input field in input.php. I press submit
- Values are gone. The only value I see is from 3rd input field
Input page:
Text fields are created dynamically. They will have their values back once I click back button (not browser back button) on display.php
$qV_snsn = unserialize($_SESSION['qV_snsn']);
<? for ($i=1;$i<=$sn;$i++) {?>
<input class="input" type="text" name="qV_snsn[<?echo $i?>]" id="qV_snsn<?echo $i?>" value="<?echo $qV_snsn[$i] ?>" /></td>
Display page (just to print the values):
Display of values:
$_SESSION['qV_snsn'] = serialize($_POST['qV_snsn']);
Could someone please tell me what I am doing wrong. This works fine as long as I don't change the values.