PHP get URL content [duplicate]

2019-08-30 06:04发布

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 

标签: php url
2条回答
干净又极端
2楼-- · 2019-08-30 06:37

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

查看更多
祖国的老花朵
3楼-- · 2019-08-30 07:03

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.

查看更多
登录 后发表回答