Jump to content

sessions automatically declaring from a _GET???


PhoenixTwo

Recommended Posts

Hi all!

Just want to thank everyone in advance for their help, and that everyone has a great day/night (in my case)..

 

My problem is this... (take it easy on me guys, I'm still a n00b to these "sessions")..

 

I have three pages, one called order.php, one called search.php, and the other called view.php...

 

order.php and view.php both have the session_start() declarations at the beginning, as search.php does not seeing as it is 'included' in the view.php page.

 

the functionality of these 3 pages are as follows, search.php searches a db, retrieves data, and allows to call a JS function which brings together some variables, and creates a url with order.php?var1=hi&var2=bye, for example...

 

now in the order.php page, for some reason, without actually declaring a session array (in this case, SESSION['cart'][$productid]), that session array automatically reads the _GET product key and stores it in that session... (i've tried calling it, and it's already stored in the session).

 

im trying to create a session array kind of like a shopping cart.. where if that productid gets stored in a session with a quantity count, and retrieves it and can update if the product gets ordered more than once in one session...

although if i do _SESSION['cart'][$productid]++, it gets incremented by one from what it is supposed to..

 

oh, and another thing.. the code i created before i started hacking at it trying to get it right, actually worked as it was supposed to in IE, but the problems arose in FF.

 

if anyone needs more explanation, i can do so as my explanation skills are obviously all over the place :) apologies for that...

 

so in summary.. session->array->productid reads the variable from the url, and when updating the quantity, it actually doubles up because it reads it from the url, and then i add the quantity from the get also..

 

hopefully someone out there can help me as i am ready to pull my hair out...

 

Thanking you all in advance

 

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.