Reply to Re: Passing array data to another PHP script and recovering the values

Your name:

Reply:


Posted by Jerry Stuckle on 12/08/07 13:41

Otis wrote:
> I have a PHP script which calls another PHP script and for some reason I
> cannot recover the array values that I am trying to pass from the first
> script to the second script in that 2nd script. I have tried everything.
>
> Passing the array values in a serialized variable, then unserializing
> does not work.
>
> Saving the arrays in a SESSION does not work - I do have the
> session_start() command as the first thing in both scripts.
>
> Trying to pass the arrays as arrays in the GET command does not work
> (chartwheel_2.php?lon=$longitude), where $longitude is my array.
>
> $lon = $_GET["lon"];
>
> does not recover my array values.
>
> BUT, what does work is if I explicitly define my array like this:
>
> $longitude[0] = 179.32;
> $longitude[1] = 181.93;
> $longitude[2] = 198.96;
>
> then serialize it and pass it over.
>
> Is there something "funny" about arrays that makes them act in any
> strange way that I am unaware of?
>
> The only other thing that seems to work is passing each individual array
> value over as a separate value in the GET. But I am afraid I will run
> out of space using the GET as I have a lot of elements to pass.
>
> chartwheel_2.php?lon1=$longitude[1]&lon2=$longitude[2]&lon3=$longitude[3]&lon4=$longitude[4];
>
>
> I just can't comprehend why I would have to individually pass each
> element over and not be able to use serialize or sessions or a straight
> GET which passes the whole array at once and not individual elements.
>
> I have spent hours on this, read help files and other notes, and it is
> driving me nuts.
>
> Thank you.
>
>
> Odie
>

It should work find to pass in the session. But you didn't post your
code and my crystal ball is in the shop, so I have no idea what your
problem might be.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[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

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