Re: [PHP] store array into session variable and get it back later

2008-10-02 Thread Stut
On 1 Oct 2008, at 20:42, Per Jessen wrote: Stut wrote: On 1 Oct 2008, at 11:40, Per Jessen wrote: Alain Roger wrote: how can i get the 'name' value for each row in this session stored array ? thx. You haven't stored an array in the session, you've tried to store an object of class

[PHP] store array into session variable and get it back later

2008-10-01 Thread Alain Roger
Hi, i have a 2 dim array defined as following: class CBreadcrumb { // array holding the complete Breadcrumb var $crumb = array(); /* * Constructor */ function CBreadcrumb() { } /* * Add new stage */ function Add($name, $link,

Re: [PHP] store array into session variable and get it back later

2008-10-01 Thread Per Jessen
Alain Roger wrote: how can i get the 'name' value for each row in this session stored array ? thx. You haven't stored an array in the session, you've tried to store an object of class CBreadcrumb. Which AFAIK isn't supported. /Per Jessen, Zürich -- PHP General Mailing List

Re: [PHP] store array into session variable and get it back later

2008-10-01 Thread Stut
On 1 Oct 2008, at 11:40, Per Jessen wrote: Alain Roger wrote: how can i get the 'name' value for each row in this session stored array ? thx. You haven't stored an array in the session, you've tried to store an object of class CBreadcrumb. Which AFAIK isn't supported. It is supported but

Re: [PHP] store array into session variable and get it back later

2008-10-01 Thread Frank Arensmeier
1 okt 2008 kl. 12.31 skrev Alain Roger: ... later on i try to use the content of this array, bt without success. Here is what i do: $bci = array($_SESSION['bc']); array_push($bci,$_SESSION['bc']); foreach($bci as $key=$value) { echo bci : .$bci[$key]['name']; echo br/; } how can i

Re: [PHP] store array into session variable and get it back later

2008-10-01 Thread Alain Roger
On Wed, Oct 1, 2008 at 2:43 PM, Frank Arensmeier [EMAIL PROTECTED] wrote: 1 okt 2008 kl. 12.31 skrev Alain Roger: ... later on i try to use the content of this array, bt without success. Here is what i do: $bci = array($_SESSION['bc']); array_push($bci,$_SESSION['bc']);

Re: [PHP] store array into session variable and get it back later

2008-10-01 Thread Alain Roger
later on i try to use the content of this array, bt without success. Here is what i do: $bci = array($_SESSION['bc']); array_push($bci,$_SESSION['bc']); foreach($bci as $key=$value) { echo bci : .$bci[$key]['name']; echo br/; } how can i get the 'name' value for each row in

Re: [PHP] store array into session variable and get it back later

2008-10-01 Thread Thodoris
This is what i did afterall, but when i unserialize it like this way: $bci = unserialize($_SESSION['bc']); foreach($bci as $key=$value) { echo bci : .$key; echo br/; } i get absolutely the same result as the code below. in fact $key returns me the 2 variables

Re: [PHP] store array into session variable and get it back later

2008-10-01 Thread Larry Brown
how about: $bci = $_SESSION['bc']; foreach($bci-crumb as myCrumb) { echo br/value['name'] :.$myCrumb['name'].br/; echo br/value['link'] :.$myCrumb['link'].br/; echo br/value['id'] : .$myCrumb['id'].br/; } You are wanting to loop through the crumbs rather than looping objects. There

Re: [PHP] store array into session variable and get it back later

2008-10-01 Thread Per Jessen
Stut wrote: On 1 Oct 2008, at 11:40, Per Jessen wrote: Alain Roger wrote: how can i get the 'name' value for each row in this session stored array ? thx. You haven't stored an array in the session, you've tried to store an object of class CBreadcrumb. Which AFAIK isn't supported. It

Re: [PHP] Store array as Session Variable

2003-07-29 Thread Pradeep D'souza
[EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Tuesday, July 29, 2003 1:00 AM Subject: Re: [PHP] Store array as Session Variable $details is empty !! Thanks --Pushpinder On Monday, July 28, 2003, at 03:31 PM, CPT John W. Holmes wrote: $details is an array (just like $company_name

[PHP] Store array as Session Variable

2003-07-28 Thread Pushpinder Singh Garcha
hello All, I am trying to store an array as a session variable. while ($row = mysql_fetch_array($result)) { if ( !is_array($company_name) ) $company_name = array(); array_push($company_name, $row['company']); // try to register session variable

Re: [PHP] Store array as Session Variable

2003-07-28 Thread Chris Shiflett
--- Pushpinder Singh Garcha [EMAIL PROTECTED] wrote: I am trying to store an array as a session variable. Based on your code, it looked like your question had little to do with storing an array as a session variable. To do that, this works: $_SESSION['myarray'] = $myarray; while ($row =

Re: [PHP] Store array as Session Variable

2003-07-28 Thread CPT John W. Holmes
$details is an array (just like $company_name was). Try to view print_r($details); and see what you get. ---John Holmes... - Original Message - From: Pushpinder Singh Garcha [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, July 28, 2003 3:18 PM Subject: [PHP] Store array as Session

Re: [PHP] Store array as Session Variable

2003-07-28 Thread Pushpinder Singh Garcha
PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, July 28, 2003 3:18 PM Subject: [PHP] Store array as Session Variable hello All, I am trying to store an array as a session variable. while ($row = mysql_fetch_array($result)) { if ( !is_array($company_name) ) $company_name = array

Re: [PHP] Store array as Session Variable

2003-07-28 Thread Chris Shiflett
--- Pushpinder Singh Garcha [EMAIL PROTECTED] wrote: I am trying to store the value in row['company'] in an array called $company_name. I see now. I think you might find this a bit simpler (if I understand correctly): $company_name = array(); while ($row = mysql_fetch_assoc($result)) {

Re: [PHP] Store array as Session Variable

2003-07-28 Thread Pushpinder Singh Garcha
Thanks Chris, I am able to see the contents of the $company_name array. The next part involves storing this as a session variable. I am trying to link this page to another search page using the a href=\full-profile.php?name=.$row['company']. \--Link--/a while ($row =

Re: [PHP] Store array as Session Variable

2003-07-28 Thread CPT John W. Holmes
I am able to see the contents of the $company_name array. The next part involves storing this as a session variable. I am trying to link this page to another search page using the a href=\full-profile.php?name=.$row['company']. \--Link--/a If you're passing the company name in the URL,

Re: [PHP] Store array as Session Variable

2003-07-28 Thread Chris Shiflett
--- Pushpinder Singh Garcha [EMAIL PROTECTED] wrote: I am able to see the contents of the $company_name array. The next part involves storing this as a session variable. Assuming $company_name is set correctly, as you verified, this should suffice: $_SESSION['company_name'] = $company_name; I

Re: [PHP] Store array as Session Variable

2003-07-28 Thread Pushpinder Singh Garcha
Thanks John, I used the $_GET['name'] on the next page to access the selection. http://psg.local/~psgarcha/CRM/full-profile.php?name=jack http://psg.local/~psgarcha/CRM/full-profile.php?name=tim http://psg.local/~psgarcha/CRM/full-profile.php?name=mary

Re: [PHP] Store array as Session Variable

2003-07-28 Thread Chris Shiflett
--- Pushpinder Singh Garcha [EMAIL PROTECTED] wrote: However if I decided to use the sessions approach how would I go about it? I am just curious to find out why $_SESSION['company_name'] = $company_name; duz not werk for me! Did you use session_start() like I mentioned? If so, you are

Re: [PHP] Store array as Session Variable

2003-07-28 Thread Pushpinder Singh Garcha
Hello Chris, I am using session_start(). All the pages after the login page use sessions and will redirect the user to the login page, if he/she is NOT logged in. So I am guessing the error lies in my logic somewhere. Thanks again. --Pushpinder On Monday, July 28, 2003, at 04:51 PM, Chris

Re: [PHP] Store array as Session Variable

2003-07-28 Thread Chris Shiflett
--- Pushpinder Singh Garcha [EMAIL PROTECTED] wrote: I am using session_start(). All the pages after the login page use sessions and will redirect the user to the login page, if he/she is NOT logged in. You're not using IIS by chance are you? If so, I think you will find this link helpful:

Re: [PHP] Store array as Session Variable

2003-07-28 Thread Pushpinder Singh Garcha
Hello Chris, I am using Apache webserver on the MAc Jaguar OS Platform Regards --Pushpinder On Monday, July 28, 2003, at 05:02 PM, Chris Shiflett wrote: --- Pushpinder Singh Garcha [EMAIL PROTECTED] wrote: I am using session_start(). All the pages after the login page use sessions and will

Re: [PHP] Store array as Session Variable

2003-07-28 Thread Rob Adams
); and see what you get. ---John Holmes... - Original Message - From: Pushpinder Singh Garcha [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, July 28, 2003 3:18 PM Subject: [PHP] Store array as Session Variable hello All, I am trying to store an array as a session