MichaelMackey Posted July 9, 2008 Share Posted July 9, 2008 Hi, as the title says I have an issue where I can get the $_GET variable to send the proper item to the URL, but if I try and retrieve it it will fail. So I need to get the value "St.%20John's" from my URL, but the GET can't seem to process it right and returns St.John\ Would the easiest method here just to assign a different value to the apostrophe and then reassign it later, or is there something I can do to get it to work? Thanks Link to comment https://forums.phpfreaks.com/topic/113979-solved-retreiving-a-_get-variable-that-has-an-apostraphe/ Share on other sites More sharing options...
p2grace Posted July 9, 2008 Share Posted July 9, 2008 More than likely the variable has the slashes due to addslashes or mysql_real_escape_string and you're trying to echo it in an html form using value='' which of course will end the display after the apostrophe. So your best bet is to probably add stripslashes() to the variable before displaying it. If this doesn't help try posting some code so we can take a closer look. Thanks. Link to comment https://forums.phpfreaks.com/topic/113979-solved-retreiving-a-_get-variable-that-has-an-apostraphe/#findComment-585810 Share on other sites More sharing options...
MichaelMackey Posted July 9, 2008 Author Share Posted July 9, 2008 Ah yes you were right. I had assumed it was something like that but I had been focusing in the wrong areas to fix it, it suddenly clicked when I read what you said. Thanks. Link to comment https://forums.phpfreaks.com/topic/113979-solved-retreiving-a-_get-variable-that-has-an-apostraphe/#findComment-585825 Share on other sites More sharing options...
discomatt Posted July 9, 2008 Share Posted July 9, 2008 Also, urlencode() any data you're going to put in a URL query string. Link to comment https://forums.phpfreaks.com/topic/113979-solved-retreiving-a-_get-variable-that-has-an-apostraphe/#findComment-585840 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.