...

View Full Version : URL get problem



ole90
03-19-2010, 03:09 PM
Hey all,

I have a program which gets a URL from the current url. example:


http://www.mysite.com/gotolink.php?url=http://www.google.com/

I can get the url if the address is as simple above, but when the address contains &, it fails. i.e.


http://www.mysite.com/gotolink.php?url=http://www.google.com/?action=site&id=2&h=3923283992392

Because GET will stop when it gets to the link & because it thinks its another variable. How do I go about getting a whole url?

Thanks

SKDevelopment
03-19-2010, 03:36 PM
You need to urlencode() (http://php.net/urlencode) values in the URL query string. Please see Example #2 at the PHP Manual page for urlencode() (http://php.net/urlencode).

abduraooft
03-19-2010, 03:36 PM
echo urldecode(http_build_query($_GET));



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum