svgmx5 Posted January 12, 2012 Share Posted January 12, 2012 So i'm having some sort of an issue. what i'm trying to do is to get the name from an URL using GET that includes the "&" symbol. I have a link and that link looks like this: name_of_company_&_member. What im trying to do is to get that whole line using Get and echoing on a page. The problem is that the line cuts off after "company_" because it reads the & symbol as something different. Does anyone know how i can be able to retrieve the whole line including everything after the & symbol? i tried using the special character "%26" but i still get the same result. Quote Link to comment https://forums.phpfreaks.com/topic/254869-converting-the-symbol-into-special-characters-in-url/ Share on other sites More sharing options...
trq Posted January 12, 2012 Share Posted January 12, 2012 As you have discovered, & has special meaning in a url. Don't use it. Quote Link to comment https://forums.phpfreaks.com/topic/254869-converting-the-symbol-into-special-characters-in-url/#findComment-1306836 Share on other sites More sharing options...
svgmx5 Posted January 12, 2012 Author Share Posted January 12, 2012 well if it has to be used...what could be the alternative? is there one? Quote Link to comment https://forums.phpfreaks.com/topic/254869-converting-the-symbol-into-special-characters-in-url/#findComment-1306914 Share on other sites More sharing options...
litebearer Posted January 12, 2012 Share Posted January 12, 2012 Perhaps... if you described in detail why it HAS to be used, an alternative might present itself Quote Link to comment https://forums.phpfreaks.com/topic/254869-converting-the-symbol-into-special-characters-in-url/#findComment-1306917 Share on other sites More sharing options...
.josh Posted January 12, 2012 Share Posted January 12, 2012 would help if you show a full example URL and the code you're currently using. Quote Link to comment https://forums.phpfreaks.com/topic/254869-converting-the-symbol-into-special-characters-in-url/#findComment-1306934 Share on other sites More sharing options...
kicken Posted January 12, 2012 Share Posted January 12, 2012 You just have to urlencode() the value before you stick it into the url. If your still having problems after that, you'll have to post code so we can see where you've made the mistake. Quote Link to comment https://forums.phpfreaks.com/topic/254869-converting-the-symbol-into-special-characters-in-url/#findComment-1306960 Share on other sites More sharing options...
.josh Posted January 12, 2012 Share Posted January 12, 2012 You just have to urlencode() the value before you stick it into the url. If your still having problems after that, you'll have to post code so we can see where you've made the mistake. well he said he tried a urlencoded & and it didn't work. I suspect he's decoding it before parsing it. Quote Link to comment https://forums.phpfreaks.com/topic/254869-converting-the-symbol-into-special-characters-in-url/#findComment-1306971 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.