Harry
Harry

Reputation: 1

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 GET 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?

Upvotes: 0

Views: 247

Answers (2)

genesis
genesis

Reputation: 50974

rawurlencode() is what are you searching for

demo

result:

/login.php?return=%2Fupdate.php%3FNumber2%3D011%26id%3D9696b8

Upvotes: 4

Delan Azabani
Delan Azabani

Reputation: 81412

You need to escape the query parameter with rawurlencode().

The result will then be

/login.php?return=%2Fupdate.php%3FNumber2%3D011%26id%3D9696b8

Upvotes: 4

Related Questions