What happens if a URL link is like this
http://abc.com/123.php?p=1?source=yahoo&key=56
can 123.php retrieve all parameters?
What happens if a URL link is like this
http://abc.com/123.php?p=1?source=yahoo&key=56
can 123.php retrieve all parameters?
In PHP $_GET will hold the following ( result of var_dump($_GET) )
array(2) { ["p"]=> string(14) "1?source=yahoo" ["key"]=> string(2) "56" }
If you want to use the question mark (or other reserved chars) use urlencode
Test it yourself with:
print_r($_GET);
I tested it an I get:
Array ( [p] => 1?source=yahoo [key] => 56 )
If you have control over the string appended to the url use urlencode.
From the RFC 1738 - Uniform Resource Locators (URL):
only alphanumerics, the special characters
$-_.+!*'(),, and reserved characters used for their reserved purposes may be used unencoded within a URL.
The character ? is a reserved character. Since the URL you give is not using it for its reserved purpose (separating the "path" from the "searchpart"), the URL is illegal, and you shouldn't rely on any particular behaviour.
Encode the ? character, and ensure that the URL is legal if you want predictable behaviour.