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?? Quote Link to comment 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(). Quote Link to comment Share on other sites More sharing options...
DarkWater Posted August 1, 2008 Share Posted August 1, 2008 urlencode(). Quote Link to comment 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. Quote Link to comment 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? Quote Link to comment 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! Quote Link to comment 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.