Jump to content

Sessions, need code


jwk811

Recommended Posts

How will I get data using php when I user clicks on a button? I want it so when someone clicks add to cart the item will go to another (their cart) and so will they to check it. I need that data to stay there even when they go to another page and some back. If someone could give me more detailed information that would be great but right now I'm just trying to get this one part down.
Link to comment
Share on other sites

You might also need to call session_start() at the top of your page too (before ANY html at all, even blank lines.  If you have trouble, check the thread on header errors).

You might not need to call it, it depends on your php configuration.

Once sessions are active (triggered by session_start()), then any data you place into the $_SESSION[] array will be available between requests.
Link to comment
Share on other sites

How will I get that data to the other page? If I have session_start at the top. Then where my button is that says add to cart how will I be able to add that item to the cart? $_SESSION[]... what do i put between the brackets and how to make the info send? Do I add that in the form somehow?
Link to comment
Share on other sites

I know that, this was my message.

[quote]How will I get that data to the other page? If I have session_start at the top. Then where my button is that says add to cart how will I be able to add that item to the cart? $_SESSION[]... what do i put between the brackets and how to make the info send? Do I add that in the form somehow?[/quote]

Now how am I going to get this to work?
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.