andrewEmbassy
Programmer
Okay, so here's my issue. I'm working on a shopping cart and we've got it set up so the users cart is a cookie kept on their machine, with they key names being the itemId's and the values being the number of each they've purchased.
I'm writing the receipt page that'll have "thank you! your order went through fine, here's what you've purchased... etc."
Now, we're using a third party credit card verification system, and the receipt page is hosted on their server so the cookie from our domain won't work. Also, there's very limited variables we can pass to the third party server about the purchase- aside from the amount and billing/shipping info, there's not much else the server will take.
It seems like we've got two options (without throwing the whole cart system out the window and creating carts on the database, something that I'm still contemplating).
One: I can figure out how to set multiple domains on the cookie. I've been told this is kind of a difficult thing to do and that I may run into browser issues along with security issues. Is there any way I can write a cookie so it can be read by multiple domains?
two: I can take my cart, convert it into a string, post that string in the x_description variable they give me, and then when it's echoed to the receipt page compile that string into an array and use it to populate the info.
This option seems like it would be the simplest, but while I could use split() to make a one dimensional array, I need to use it to make a multi-dimensional array. Ideas? I can write the string fine, right now I've got it something like this:
SM150=>1,SM344=>3,SM250A=>2 Where SM150 is the key and 1 is the value.
How do I get that into a multi-dimensional array?
Thanks in advance...
I'm writing the receipt page that'll have "thank you! your order went through fine, here's what you've purchased... etc."
Now, we're using a third party credit card verification system, and the receipt page is hosted on their server so the cookie from our domain won't work. Also, there's very limited variables we can pass to the third party server about the purchase- aside from the amount and billing/shipping info, there's not much else the server will take.
It seems like we've got two options (without throwing the whole cart system out the window and creating carts on the database, something that I'm still contemplating).
One: I can figure out how to set multiple domains on the cookie. I've been told this is kind of a difficult thing to do and that I may run into browser issues along with security issues. Is there any way I can write a cookie so it can be read by multiple domains?
two: I can take my cart, convert it into a string, post that string in the x_description variable they give me, and then when it's echoed to the receipt page compile that string into an array and use it to populate the info.
This option seems like it would be the simplest, but while I could use split() to make a one dimensional array, I need to use it to make a multi-dimensional array. Ideas? I can write the string fine, right now I've got it something like this:
SM150=>1,SM344=>3,SM250A=>2 Where SM150 is the key and 1 is the value.
How do I get that into a multi-dimensional array?
Thanks in advance...