Reputation: 53
I am facing a problem with passing query string. In my query string the value containing a # tag when i use $_REQUEST['string']
its only return the value which is write before of # tag. There is any way to solve this problem...
My Problem is
localhost/index.php?string=adc#123
Value i get using
$_REQUEST['string']
is only abc value after # tag not capture.
please suggest me solution for this problem...
Upvotes: 0
Views: 315
Reputation: 31749
When redirecting to that page generate the query string like -
header('location:index.php?str='.urlencode('abc#123'));
It will encode the query string value.
Upvotes: 0
Reputation: 809
I assume it is because # is a reserved character which is used as an anchor to access components in your web pages, like http://example.org/index.php#header that will point to the tag which as "header" as identifier.
Did you try to escape this character or to use urlencode(...) so it won't be interpreted as an anchor? Doc : http://php.net/manual/fr/function.urlencode.php
Upvotes: 0