Re: Passing arrays as session variables

From: bill skipton (billskipton_at_hotmail.com)
Date: 10/25/04

  • Next message: Rob: "http request using fsockopen"
    Date: Mon, 25 Oct 2004 12:02:37 +0100
    
    

    Newbie answer (but I hope I'm right!)...
    You are using $SESSION where you mean $_SESSION.
    Also (may be wrong) you don't need to register $_SESSION variables
    using session_register.
    Bill.

    On 22 Oct 2004 03:47:17 -0700, pepchick@gmail.com (rachel) wrote:

    >Hi, I'm trying to use an array as a session variable.
    >
    >First, I register the array:
    >if(session_is_registered("docnum")) {
    > session_register("docnum");
    > $_SESSION['docnum'] = array();
    >}
    >
    >Then, I set up the variables in a while-loop:
    > $SESSION["docnum"][$count] = $docn;
    >(I've also tried $SESSION["docnum[$count]"], but that didn't work either)
    >
    >I pass the variable $count to another page, where I try to retrieve the docnum:
    >$docn = $_SESSION["docnum"][$count];
    >(again, I've also tried $SESSION["docnum[$count]"], but that doesn't work)
    >
    >so... how can I do this? help!


  • Next message: Rob: "http request using fsockopen"

    Relevant Pages

    • PHP 4.4.2 Session Problem
      ... Hey all...i have a strange PHP session problem. ... I have a login form that sets some session variables and the second ... the sessions will not register. ...
      (php.general)
    • Re: Session Variables - why arent novice developers warned?
      ... The user selects a Customer in a browser and enters an order. ... and the same session variables. ... You can research session state very thoroughly without finding any ... with the use of Session Variables? ...
      (microsoft.public.dotnet.framework.aspnet)
    • Soaring Webinar, Saturday, March 7th
      ... Sign up for a Soaring Webinar ... The Soaring Society of Boulder is presently a Cross Country Safety ... Register for Session 1, Session 2, or both. ...
      (rec.aviation.soaring)
    • Re: Soaring Webinar, Saturday, March 7th
      ... The Soaring Society of Boulder is presently a Cross Country Safety ... conferencing services for potential use as SSA member services. ... Register for Session 1, Session 2, or both. ...
      (rec.aviation.soaring)
    • Re: Session Variables - why arent novice developers warned?
      ... very dangerous outcome which may result when the session variables are used ... Developers want the session to be preserved when a new browser ... You can research session state very thoroughly without finding any ...
      (microsoft.public.dotnet.framework.aspnet)