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
https://forums.phpfreaks.com/topic/19839-sessions-need-code/
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
https://forums.phpfreaks.com/topic/19839-sessions-need-code/#findComment-86834
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
https://forums.phpfreaks.com/topic/19839-sessions-need-code/#findComment-86835
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
https://forums.phpfreaks.com/topic/19839-sessions-need-code/#findComment-86840
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.