Re: Passing arrays as session variables
From: bill skipton (billskipton_at_hotmail.com)
Date: 10/25/04
- Previous message: Gurble: "Re: MP3 Player and Flash Disk"
- In reply to: rachel: "Passing arrays as session variables"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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!
- Previous message: Gurble: "Re: MP3 Player and Flash Disk"
- In reply to: rachel: "Passing arrays as session variables"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|