I'm trying to pass a complex URL as a url parameter but the problem occurs if the url contains & for example I want to pass the following link as a parameter
I'm trying to get a URL as a parameter from a user and redirect user to this URL.
How could I handle this in PHP?
The whole Story:
I'm trying to make some ads analytics on flash files so user submit flash ads to a website which contains a link to the required webpage.
Now,my client needs to know how many times this flash file was clicked.To solve this I 'll till every one who submits flash to write a link to my client webpage and pass the required URL as a parameter as follows
http://myclientwebpage.com/disp.php?link=www.google.com&id=16
by this way I can update my database and get a count for how many times this link was clicked
echo "href='http://myclientwebpage.com/disp.php?link=" . $link . "'"writeecho "href='http://myclientwebpage.com/disp.php?link=" . rawurlencode($link) . "'". Then, indisp.phpcode, you'll have$_GET['link']which will contain "www.google.com&id=16" (not just "www.google.com").&which should be written as%26in the original URI. All other characters can be introduced as is.