How to encode URL parameters?
I am trying to pass parameters to a URL which looks like this: http://www.foobar.com/foo?imageurl= and I want to pass the parameters suchas and image URL which is generated itself by another API, and the link for the image turns out as: http://www.image.com/?username=unknown&password=unknown However, when I try to use the URL: http://www.foobar.com/foo?imageurl=http://www.image.com/?username=unknown&password=unknown it doesn't work.. I have also tried using encodeURI and encodeURIComponents on the imageURL, and that too doesn't work. With PHP echo urlencode("http://www.image.com/?username