开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜