Retaining array values after submit
Posted: Wed Oct 14, 2009 11:56 pm
I am wondering whether there is a way to retain array values after submission. This is what I have tried so far and it is not working. The array contains objects that I created on my own.
<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<input type="submit" name="set" id="set" value="Set Variables" />
<input name="storeArr" name="storeArr" type="hidden" value="<?php echo serialize(htmlentities($arrVars)); ?>" />
</form>
and after submission i do.
$arrVars = unserialize(html_entity_decode(stripslashes($_POST['storeArr'])));
<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<input type="submit" name="set" id="set" value="Set Variables" />
<input name="storeArr" name="storeArr" type="hidden" value="<?php echo serialize(htmlentities($arrVars)); ?>" />
</form>
and after submission i do.
$arrVars = unserialize(html_entity_decode(stripslashes($_POST['storeArr'])));