Reply to Re: "Array to String Conversion" error when constructing a multi-dimensional array

Your name:

Reply:


Posted by Jerry Stuckle on 01/23/07 12:20

Rik wrote:
> Jerry Stuckle wrote:
>> Rik wrote:
>>> drako wrote:
>>>> I got this working in the end. It seemed that having the following
>>>> variables caused some clash:
>>>>
>>>> $_POST['increment']
>>>> $_SESSION['increment']
>>>>
>>>> once I changed this to $_SESSION['increments'] (notice the plural),
>>>> then it was creating arrays within the session variable as expected,
>>>> and I can now run it through a 'foreach' loop and 'array_multisort'
>>>> in order to process the array data.
>>> Well, you're copying the POST to the SESSION somewhere in your code
>>> in that case, as it is not a PHP feature. This works fine:
>> Or, maybe register_globals is enabled?
>
> That would not overwrite the $_POST & $_SESSION arrays, and even then, the
> $_SESSION would win the $increment, and the $_POST value would be
> discarded.

As posted, that is true. But we don't know what other code he has
which isn't posted. Perhaps he has something like $increment=4; in
another place in his program.

Also, which variable wins the $increment depends on the php.ini
settings. The default is GPCS (Get/Post/Cookie/Session), but that can
be changed.

--
==================
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

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