convert URL string to array
Posted: Sat Jun 16, 2007 1:29 am
Before I spend a lot of time on this I want to get some input on possible ways to handle this...
I have a client who is using a third part shopping cart on their site. At the end of every transaction, there is a silent post back to the server where the site is hosted that allows me to capture the order #, address info, etc. Everything is clearly separated with an ampersand, BUT for each item someone has purchased, rather than giving you an array (...item[]=gold%20watch&item[]=belt&20buckle...) they have already assigned variables of item1=, item2=, etc.
So my question is, rather than having a bunch of $_POST variables predefined, is there a way to break these out into an array so I can run a loop so that no matter how many items someone buys, I don't have to create a huge number of table fields in the database to accomodate this?
-PM
I have a client who is using a third part shopping cart on their site. At the end of every transaction, there is a silent post back to the server where the site is hosted that allows me to capture the order #, address info, etc. Everything is clearly separated with an ampersand, BUT for each item someone has purchased, rather than giving you an array (...item[]=gold%20watch&item[]=belt&20buckle...) they have already assigned variables of item1=, item2=, etc.
So my question is, rather than having a bunch of $_POST variables predefined, is there a way to break these out into an array so I can run a loop so that no matter how many items someone buys, I don't have to create a huge number of table fields in the database to accomodate this?
-PM