Re: Sessions and Arrays

From: Date: Tue, 08 Apr 2003 16:44:01 +0000
Subject: Re: Sessions and Arrays
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-142909@lists.php.net to get a copy of this message
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 try: print_r($_SESSION['AppUI']); this should give you more info On Tuesday 08 April 2003 07:26 pm, Erich Kolb wrote: > There is no output for "echo $_SESSION['AppUI']['user_id'];" > > Eg. If I do: > $user_identifier = $_SESSION['AppUI']['user_id']; > if (!$user_identifier){ > echo "Nothing in the variable"; > exit; > } > > I get the "Nothing in the variable" Error, and the script ends. > > -----Original Message----- > From: Negrea Mihai [mailto:mike@spidernet.co.ro] > Sent: Tuesday, April 08, 2003 11:24 AM > To: Erich Kolb; php-general@lists.php.net > Subject: Re: [PHP] Sessions and Arrays > > > echo $_SESSION['AppUI']['user_id']; > > On Tuesday 08 April 2003 07:20 pm, Erich Kolb wrote: > > If I do: > > > > while (list($key,$val) = each($_SESSION['AppUI'])) { > > echo $key." ".$val."<br />"; > > } > > > > I get: > > > > state Array > > user_id 5 > > user_first_name Erich > > user_last_name Kolb > > user_company 1 > > user_department 1 > > user_type 1 > > user_prefs Array > > project_id 0 > > day_selected Object > > user_locale en > > base_locale en > > locale_warn > > locale_alert ^ > > styles Array > > msg > > msgNo 0 > > defaultRedirect > > cfg Array > > > > How do I get the value from the above "user_id" into a variable so > > that I can echo it, or use it to perform a db query, etc.? > > -- > Negrea Mihai > http://www.negrea.net - -- Negrea Mihai http://www.negrea.net -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQE+kvxR8hhhNOp8KlQRAuHUAJoDLXcIkuoJIi4y+Q1oDbNwSqmpdACcD+jt RmWS+dehmEI+0D8gHvVxggw= =5+52 -----END PGP SIGNATURE-----

« previous php.general (#142909) next »