Jump to content

Dynamic $_SESSION Variable - Help


ggensale

Recommended Posts

I'm trying to create a dynamic $_Session variable by:

 

$_Session[$i] = "value";

 

After I post my form the session variable in gone. 

 

Any ideas?

 

Are you using session_start() on top of the page?

 

Do you have any $_POST with the same names? (in this example, $_POS[$i])

I do have session_start();

 

Here is a better explaination of what I'm doing...I have another page in which a user will fill out a form asking them how many "items" for each section do they want to create.

 

That gets posted to the new page... And here is the code I'm using to store them:

 

foreach($_POST as $section => $value) {

    if ($value > 0)

    {

$_SESSION[$section] = "$value";

    }

}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.