Da Xing
Da Xing

Reputation: 11

How to get a URL query string which has "?" inside?

My URL looks like this:

www.xxx.com/?user&q=code/approve/realname&url=/?user&q=code/approve/myapp

When I use $_REQUEST['url'] (PHP) to get the query string, it is just "/". All of characters after ? (including) have gone.

BTW: I need to transfer such string including ? as the query string.

Upvotes: 0

Views: 89

Answers (1)

blue112
blue112

Reputation: 56602

You need to URLEncode the value before sending it.

Look at the urlencode() function for PHP.

You value will look something like :

%3Fuser%26q%3Dcode%2Fapprove%2Fmyapp

Which will be correctly interpretated by the PHP query string parser.

Upvotes: 1

Related Questions