I have a deals website with 100's of product links from each of affliate store like snapdeal, flipkart etc.. So i wrote a php file redirect.php in my home directory.
All my product links http://productlink.com are prefixed with : http://mysite.com/redirect.php?url=http://productlink.com. So when a user clicks http://mysite.com/redirect.php?url=http://productlink.com the GET url parameter http://productlink.com which is the product link is passed to redirect.php.
Now redirect.php processes the url GET parameter http://productlink.com, checks the store name and based on store name adds prefix and suffix to it properly to covert the the product link to affiliate link and redirects to store.
But the problem is my product link itself may contain ?. So in my url i will have 2 ?'s. e.g. http://mysite.com/redirect.php?url=http://productlink.com?id=red.
Now redirect.php will receive only "red" as query get parameter.
So what should i do to avoid this problem???? Waiting for help asap.