Re: Re: SESSION array problems

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Micah Gersten wrote:
>  You really should get up to speed on PHP 5.

Micah Gersten wrote:
I was referring to Nathan's examples which you cut out of the post.
function save_to_session( ) {
 global $userids , $first , $last;
 $_SESSION['user_id'] = &$userids;
 $_SESSION['first_name'] = &$first;
 $_SESSION['last_name']= &$last;
}


ahh I thought that but didn't want to assume; I am actually strictly PHP5.2+/OO and flat out refuse to use globals (preference to static class variables), and keep session usage to a minimum.

However the example I gave tedd was the only way in which I could create code to replicate his error (explaining the passing a variable by reference to session, the redefining of that referenced array as a string within the for loop and so on).

This actually turned out to be register globals turned on; however it's been so dang long since I used them, (and indeed anything pre-php5), that I forget register globals even existed; thus replicated it's functionality. [lol]

Regards!

--
nathan ( nathan@xxxxxxxxxxx )
{
  Senior Web Developer
  php + java + flex + xmpp + xml + ecmascript
  web development edinburgh | http://kraya.co.uk/
}

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux