Jump to content

Session Array


AnotherQuestion

Recommended Posts

What I would like to happen is:

 

User selects a description from a SelectMenu. On Select they post the form using GET method.

 

When the page is posted back the  user then gets alist of the items they have selected ( A mini shopping cart).

 

so far I have

 

$Bookings=array($Bookings,$_GET['BookingID']);

$_SESSION['ServicesReqID'] = $Bookings;

 

and the ECHO looks like

 

foreach($_SESSION['ServicesReqID'] as $key=>$value)

    {

        echo $key.$value;

    }

 

All that happens is the last array changes value instead of adding on

 

 

Link to comment
https://forums.phpfreaks.com/topic/176476-session-array/
Share on other sites

to my knowledge (experience), $_SESSION['ServicesReqID'][] is not permitted.

 

you must first create the array() with a common variable (e.g., $ServicesReqID[]), and then you can dump the array into a session var (e.g., $$_SESSION['ServicesReqID'] = $ServicesReqID;).

 

aside from that, i need more information regarding your form and content of various variable names .. i got out of the guessing game a while back.

 

what is $bookings in your array? $Bookings=array($Bookings,$_GET['BookingID']);

Link to comment
https://forums.phpfreaks.com/topic/176476-session-array/#findComment-930295
Share on other sites

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.