rubing Posted August 1, 2008 Share Posted August 1, 2008 hey all, i want to pass a url as the parameter in a $_GET variable (e.g) http://www.example.com/pass.php?id=7&limit=1&url=http://www.doesntwork.com/howtofix.php?works=yes&lastchar=broke These $_GET varialbles will be truncated. The variable: http://www.doesntwork.com/howtofix.php?works=yes&lastchar=broke has an '&' character which is interrupreted instead of being included. Basically I am asking, how do you escape the '&' character in a GET query??? So that it's not interpretted as the end of the variable?? Link to comment https://forums.phpfreaks.com/topic/117659-embedding-_get-in-_get/ Share on other sites More sharing options...
trq Posted August 1, 2008 Share Posted August 1, 2008 Easiest way is to use urlencode() and then urldecode(). Link to comment https://forums.phpfreaks.com/topic/117659-embedding-_get-in-_get/#findComment-605172 Share on other sites More sharing options...
DarkWater Posted August 1, 2008 Share Posted August 1, 2008 urlencode(). Link to comment https://forums.phpfreaks.com/topic/117659-embedding-_get-in-_get/#findComment-605173 Share on other sites More sharing options...
ShaunO Posted August 1, 2008 Share Posted August 1, 2008 You should always urlencode(); all strings that go into a query string. urlencode("http://www.doesntwork.com/howtofix.php?works=yes&lastchar=broke") For example. Link to comment https://forums.phpfreaks.com/topic/117659-embedding-_get-in-_get/#findComment-605174 Share on other sites More sharing options...
cooldude832 Posted August 1, 2008 Share Posted August 1, 2008 it seems excessive why not pass an primraykey from a table to identify it on the next page? Link to comment https://forums.phpfreaks.com/topic/117659-embedding-_get-in-_get/#findComment-605185 Share on other sites More sharing options...
rubing Posted August 2, 2008 Author Share Posted August 2, 2008 yeah, i should've realized that...urlencode is the simplest for my app....thanks! Link to comment https://forums.phpfreaks.com/topic/117659-embedding-_get-in-_get/#findComment-605855 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.