I am trying to pass a link within another in such a way :
http://www.1st_site.com/?u=http://www.2nd_site.com/?parameter1=xyz
I think what the problem is , parameter1=xyz is passed as a parameter for 1st_site
is there anyway to avoid that?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You need to URL-encode the entire URL which is represented as query parameter value, else it will be interpreted as part of the request URL, thus this part:
http://www.2nd_site.com/?parameter1=xyz.It’s unclear what programming language you’re using, but most of decent webbased languages provides functions/methods/classes to achieve this, e.g.
URLEncoderin Java, orc:urlandc:paramin JSP/JSTL,urlencode()in PHP andescape()in JavaScript.Here’s at least an online URL encoder: http://meyerweb.com/eric/tools/dencoder/. If you input
http://www.2nd_site.com/?parameter1=xyz, you should gethttp%3A%2F%2Fwww.2nd_site.com%2F%3Fparameter1%3Dxyzback so the request URL should effectively end up in:http://www.1st_site.com/?u=http%3A%2F%2Fwww.2nd_site.com%2F%3Fparameter1%3Dxyz