akshay Posted April 27, 2010 Share Posted April 27, 2010 Hello. I was just wondering how to pass a URL as a variable with $_GET method. For example a redirect page... Example: $url="http://yoursite.web/ref/?id=2948&name=jon&abc=xyz" $code="12345" Now when I link the two variables , the resulting link might look like : http://mysite.web/redirect.php?code=12345&url=http://yoursite.web/ref/?id=2948&name=jon&abc=xyz or, ?url=......&code=... The problem is that the "&" and "?" might interfere with each other and may deliver no result on the page. I think the solution is converting the special characters into HTML, what do you say, encryptions? Like " " (space) = %20 and "/" (slash) is %2F or %3F How to do so? Any other solution welcome. Thanks. Link to comment https://forums.phpfreaks.com/topic/199910-passing-url-as-variable-by-get-method/ Share on other sites More sharing options...
Pikachu2000 Posted April 27, 2010 Share Posted April 27, 2010 Look into urlencode() in the PHP manual. Link to comment https://forums.phpfreaks.com/topic/199910-passing-url-as-variable-by-get-method/#findComment-1049272 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.