Ignore any other _GET Variables
See, I have this return script which will return the user to the page they were denied access to because they aren't logged in, however it misses GE开发者_开发技巧T variables. Sorry if I can't explain..
For example, my url is:
/login.php?return=/update.php?Number2=011&id=9696b8
I want "return" to contain:
/login.php?return=**/update.php?Number2=011&id=9696b8**
However it thinks that "id" is a seperate get variable and misses it and gives me only:
/login.php?return=**/update.php?Number2=011**&id=9696b8
I understand why it's happening, just not how to prevent it.. Any ideas?
You need to escape the query parameter with rawurlencode()
.
The result will then be
/login.php?return=%2Fupdate.php%3FNumber2%3D011%26id%3D9696b8
rawurlencode()
is what are you searching for
demo
result:
/login.php?return=%2Fupdate.php%3FNumber2%3D011%26id%3D9696b8
精彩评论