开发者

Detect URL tags example.com/page.php#anycontent

开发者 https://www.devze.com 2023-03-05 00:48 出处:网络
How can I identify this type of tags: example.com/file.php#inbox or example.com/another.php#spam Like Gmail is detecting #inbox #spam #mycontent

How can I identify this type of tags:

example.com/file.php#inbox or example.com/another.php#spam

Like Gmail is detecting #inbox #spam #mycontent

I have tried with $_SERVER['REQUEST_URI'] but it does not work开发者_StackOverflow...


The hash part (everything after and including the # character) is not sent to the server. Only the client side (javascript) can read and use it.

The hash property can be requested from the Javascript location objects: location.hash.

If you want to pass data to a page, use GET parameters:

page.php?key=value

In PHP, you can use $_GET['key'] to retrieve value.

0

精彩评论

暂无评论...
验证码 换一张
取 消