I have a client who is wanting to create a link which contains product codes so that his customers hit a page with just those products displayed in an attempt to increase conversion rates from affilliate sites.
My question is whats the best way to send these multiple products in a single URL
For example:
http://www.mydomain.co.uk/bespoke-list.php?catNo=234-324-232-343
Obviously then the site would grab the codes from the string and display them…
We’re going to be using PHP!
Thanks in advance.
You can certainly send the like you described, with
-as separator. The querystring variables are stored in the $_GET array in PHP, so your example numbers can be accessed like this:Another way could be to store them directly as an array in the querystring, like this:
http://www.mydomain.co.uk/bespoke-list.php?id%5B%5D=234&id%5B%5D=324&id%5B%5D=232&id%5B%5D=343
Then you can get the ids directly without explode:
But when I look at it, the first one is certainly a more attractive URL. 🙂