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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.