0

I have a URL

http://localhost/ifocus/v3/services.php#nav-section2

I want to get hashtags from URL, EX : if the URL contains "#" so capture it via PHP

nav-section2

When i do

echo $_SERVER['REQUEST_URI'];

// Output
/ifocus/v3/services.php 
Community
  • 1
  • 1
Harsha M V
  • 54,075
  • 125
  • 354
  • 529

2 Answers2

8

You can't detect the hash parameter of the URL in PHP, you would need to use JavaScript.

You could make a jquery call to php which passes the hash data (window.location.hash) to a PHP script as a URL parameter and return TRUE/FALSE though.

Ryan
  • 3,552
  • 1
  • 22
  • 39
2

You can not capture this content for that you need js(client side script)

Er.KT
  • 2,852
  • 1
  • 36
  • 70