note 32965 modified in function.serialize by aidan
| From: | aidan@php.net | Date: | Thu, 24 Jun 2004 10:18:53 +0000 |
| Subject: | note 32965 modified in function.serialize by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-71576@lists.php.net to get a copy of this message | ||
People usually use 'hidden' fields when they submit some variables from previous step to
the next step even if they have so many varibles to send. It will look like following form.
<form name='tmpForm' method='post' action='nextStep.php'>
<input type='hidden' name='var[name]'
value='<?=$var[name]?>'>
<input type='hidden' name='var[id]' value='<?=$var[id]?>'>
<input type='hidden' name='var[address]'
value='<?=$var[address]?>'>
<input type='hidden' name='var[age]'
value='<?=$var[age]?>'>
<input type='hidden' name='var[gender]'
value='<?=$var[gender]?>'>
<input type='hidden' name='var[car]'
value='<?=$var[car]?>'>
.
.
.
</form>
Look at the following codes. It is more simplified. I'd better use base64_encode and serialize
than stripslashes and serialize.
<form name='tmpForm' method='post' action='nextStep.php'>
<input type='hidden' name='var'
value='<?=base64_encode(serialize($var))?>'>
</form>
Have Fun !!!
--was--
People usually use 'hidden' fields when they submit some variables from previous step to
the next step even if they have so many varibles to send. It will look like following form.
<form name='tmpForm' method='post' action='nextStep.php'>
<input type='hidden' name='var[name]'
value='<?=$var[name]?>'>
<input type='hidden' name='var[id]' value='<?=$var[id]?>'>
<input type='hidden' name='var[address]'
value='<?=$var[address]?>'>
<input type='hidden' name='var[age]'
value='<?=$var[age]?>'>
<input type='hidden' name='var[gender]'
value='<?=$var[gender]?>'>
<input type='hidden' name='var[car]' value='<?=$var[car]'>
.
.
.
</form>
Look at the following codes. It is more simplified. I'd better use base64_encode and serialize
than stripslashes and serialize.
<form name='tmpForm' method='post' action='nextStep.php'>
<input type='hidden' name='var'
value='<?=base64_encode(serialize($var))?>'>
</form>
Have Fun !!!
http://php.net/manual/en/function.serialize.php