Reply to Re: get array

Your name:

Reply:


Posted by cldmismgr on 12/07/06 10:19

Krustov wrote:
> <comp.lang.php>
> <kirke>
> <6 Nov 2006 03:24:08 -0800>
> <1162812248.829522.49860@b28g2000cwb.googlegroups.com>
>
> > I have two arrays in previous page and use the arrays in next page.
> > (Action page)
> > how can I do this?
> >
>
> - write them to a flat file
>
> - read the flat file on the next page
>
>
> --
> www.phpchatroom.co.uk

This can be done with serialize and urlencode as follows.
<?php
if (isset($_REQUEST) {
$decode_hidden = urldecode($_REQUEST['hidden_array_value'];
$new_array = unserialize($decode_hidden);
}
$array[] = 'one';
$array[] = 'two';
$pass_array = serialize($array);
$encode_array = urlencode($pass);
print "<form>";
print "<input type='hidden' name='hidden_array_value'
value='$encode_array' ";
print "</form>";
?>

The serialized array must be urlencoded to handle the characters
injected by the serialize command.

Craig

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация