You are here: Re: php arrays « PHP Programming Language « IT news, forums, messages
Re: php arrays

Posted by Erwin Moller on 03/20/06 12:34

Henrik Hansen wrote:

> wesley@ispace.co.za writes:
>
>> Can i send an array from one php script to another? If so, how?
>> Thanks Wes
>
> Serialize the array or send it via a html form or use a session
> variable: eks,
>
>
> $_SESSION["myarray"] = serialize($myarray);
>
> Then on the dest. page you can use $myarray =
> unserialize($_SESSION["myarray"]);
>
>

Just one addition:

Henrik's examples are OK, but in case of Session, you do not have to
serialize, this will be done by the sessionhandler before storing.

In case of POST of GET: Yes please: Serialize AND do urlencoding to be sure
all characters are transmitted safely.

For testing, be sure you add some newlines and ' and " and & into the
information stored in the arrays, to check if they all get transmitted
right.

Regards,
Erwin Moller

 

Navigation:

[Reply to this 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

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