473,383 Members | 1,896 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

I have a problem with sessions and arry

3
Hi,
I need your help!

I have this script
Expand|Select|Wrap|Line Numbers
  1. <?php echo '<pre>' . print_r($_SESSION, TRUE) . '</pre>'; ?>
  2.  
  3. and I see:
  4. Array
  5. (
  6.     [Zid] => 1
  7.     [member] => Array
  8.         (
  9.             [id] => 3
  10.             [group_id] => 1
  11.             [first_name] => Pippo
  12.             [last_name] => muse
  13.             [email] => pippo@pippo.com
  14.             [phone] => 001111111
  15.             [website] => www.pippo.com
  16.  
  17.         )
  18.  
  19. )
I need to display on the page; Pippo
the content of the variable $first_name;
and write:
echo $member[first_name];
but doesn't work
can you help me?
Thanks
Gerry
May 11 '14 #1

✓ answered by Luuk

hmm, i overlooked an array, because you did not use '[code]' tags its a bit ......

the answer should be:
Expand|Select|Wrap|Line Numbers
  1. echo $_SESSION['member']['first_name'];
  2.  

4 1143
Luuk
1,047 Expert 1GB
rtfm....... ;-)

But i also did not read them, but did you try:
Expand|Select|Wrap|Line Numbers
  1. echo $member['first_name'];
  2.  
May 11 '14 #2
GerryG
3
$member['first_name']
it doesn't work.
...... is empty!
May 11 '14 #3
Luuk
1,047 Expert 1GB
hmm, i overlooked an array, because you did not use '[code]' tags its a bit ......

the answer should be:
Expand|Select|Wrap|Line Numbers
  1. echo $_SESSION['member']['first_name'];
  2.  
May 11 '14 #4
GerryG
3
Work!
Thanks........
May 11 '14 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Phil Powell | last post by:
I have a form that will be preserving form data prior to processing the form data. Upon clicking a certain submit button you will go to another PHP script that will contain the following code: ...
1
by: Dan Walker | last post by:
Please help. I seem to have a major problem with sessions on my setup. No simple example seems to work. Example below: page1.php: <?php // page1.php
5
by: Yoyoma_2 | last post by:
Hello, i'me having a wierd problems with sessions. PHP 4.3.3, Register globals is on, and the sessions module is installed. if i have a page like this: <? session_start(); $_SESSION="blue";...
0
by: Mountain Man | last post by:
Hi, I'm having trouble with sessions. Text fields from a form aren't getting updated when the form is resubmitted. On the other hand, my radio buttons are updated every time. Many thanks to...
4
by: vesely | last post by:
Hi all, I'm currently relying on logged-in users hitting "logout" (logoff) before they leave, in order to terminate the session. With PHP the session filename is in a cookie that lasts for the...
10
by: Mark H | last post by:
Hey all-- I'm building a database and I basically need to keep out people who aren't authorized, but it's not like I need top security here. I'm just doing basic user/pass of a SQL database, and...
0
by: Michael J. Wendell | last post by:
Hello, I am trying to debug an issue with sessions in my ASP 3.0 web application, which runs fine on WIN2K Pro and WINXP Pro, yet fails to function correctly on WIN2K Advanced Server. My actual...
1
by: Doron | last post by:
Hi, Is there any way to associate SQL text from the V$%SQL% views with sessions. A piece of code in our application locks up a critical table about once a month. I suspect that the code is not...
5
by: salmankamkoriwala | last post by:
Default Working with Sessions in Multi Tab Browsers - PHP Hi, I am working on the php project and been stuck on Managing Session in Multiple tabs. My Problem is --- When i open a page in...
4
by: tshad | last post by:
How do you deal with sessions on IE7? Each tab seems to share the same session? This is a real problem as a person could go to the site, leave the site open and open another page and be still...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.