On Wednesday 15 January 2003 08:59 pm, Danielle van Gladbach wrote:
> I am trying to send an array from one php to another:
>
> $org["index-A"]=17010000;
> $org["index-B"]=12090000;
>
> print "<a href=\"test2.php?org=".$org."\">test2</a><BR>\n";
>
> But if I try to read te array in test2.php, I get "Warning: Variable
> passed to each() is not an array ".

others have discussed the particular error and things to try, so i won't 
do that here.  instead i point out that if the array is going to be any
significant length, then you might want to use some method of
sending the array other than sending it in the URI.

the particular limits on URI length are browser and web server (and
sometimes OS dependent), but i'd be conservative about sending
arrays along.  i'd probably completely give up on sending them in
the URI and instead construct some other way.

e.g., you might have a system whereby you encode the array
somehow into something easily parsed, e.g., index->value
pairs separated by a special delimiter, or urlencoded index
and value separated by a space.  save the encoded format
on the disk.  give it a random name.  then pass the name to
the other URL as a GET param.

you would also have a reaper program (maybe running through
crontab if you're on Unix, or some windows scheduler otherwise)
that deletes array files that are more than, say, 5 minutes  old.

tiger

-- 
Gerald Timothy Quimpo  tiger*quimpo*org gquimpo*sni-inc.com tiger*sni*ph
Public Key: "gpg --keyserver pgp.mit.edu --recv-keys 672F4C78"
                   Veritas liberabit vos.
                   Doveryai no proveryai.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to