Re: Sessions and Arrays
| From: | Erich Kolb | Date: | Tue, 08 Apr 2003 16:50:55 +0000 |
| Subject: | Re: Sessions and Arrays | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-142912@lists.php.net to get a copy of this message | ||
Here is the result:
cappui Object ( [state] => Array ( [SAVEDPLACE-1] => [SAVEDPLACE] =>
m=system ) [user_id] => 5 [user_first_name] => John [user_last_name] => Doe
[user_company] => 1 [user_department] => 1 [user_type] => 1 [user_prefs] =>
Array ( [LOCALE] => en [TABVIEW] => 0 [SHDATEFORMAT] => %m/%d/%Y
[TIMEFORMAT] => %I:%M %p [UISTYLE] => default ) [project_id] => 0
[day_selected] => cdate Object ( [ts] => 1049816418 [Y] => 2003 [M] => 4 [D]
=> 8 [h] => 10 [m] => 40 [s] => 18 [change] => 0 [format] => [weekday] =>
2 ) [user_locale] => en [base_locale] => en [locale_warn] => [locale_alert]
=> ^ [styles] => Array ( ) [msg] => [msgNo] => 0 [defaultRedirect] => [cfg]
=> Array ( [dbtype] => mysql [dbhost] => localhost [dbname] => dotProject
[dbuser] => root [dbpass] => mysql [host_locale] => en [host_style] =>
default [root_dir] => /www/dotproject [company_name] => My Company
[page_title] => Intranet [base_url] =>
http://myproject.mydomain.com/dotproject/
[site_domain] => mydomain.com
[show_all_tasks] => [enable_gantt_charts] => 1 [log_changes] => 1
[daily_working_hours] => 8 [debug] => ) )
It has all the same information as when I:
> > while (list($key,$val) = each($_SESSION['AppUI'])) {
> > echo $key." ".$val."<br />";
> > }
"Negrea Mihai" <mike@spidernet.co.ro> wrote in message
news:200304081944.01959.mike@spidernet.co.ro...
-----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-----