http://localhost/mysite/#id=98b7ee047f0a4fd6530d2538f7f929cc&com=289916
I need to get values of 'id' and 'com'. I have to put '#' symbol in front parameter, because I need the page without refreshing itself.
http://localhost/mysite/#id=98b7ee047f0a4fd6530d2538f7f929cc&com=289916
I need to get values of 'id' and 'com'. I have to put '#' symbol in front parameter, because I need the page without refreshing itself.
Try this :
$url = 'http://localhost/mysite/#id=98b7ee047f0a4fd6530d2538f7f929cc&com=289916';
echo "<pre>";
print_r(parse_url($url));
Output :
Array
(
[scheme] => http
[host] => localhost
[path] => /mysite/
[fragment] => id=98b7ee047f0a4fd6530d2538f7f929cc&com=289916
)
For getting the url you can use
$url = $_SERVER['REQUEST_URI'];
then you can apply the above method Quoted by Prasanth Bendra.
echo ""; print_r(parse_url($url));