是否可以通过PHP访问查询字符串中的锚点? [英] Is it possible to access anchors in a querystring via PHP?

查看:160
本文介绍了是否可以通过PHP访问查询字符串中的锚点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个可通过这样的URL访问的页面:

I have a page that is accessed via a URL like this:

http://power-coder.net/Test/something .php?id = 3#Page1

我知道如何使用$ _GET访问id参数,但是我有办法访问#Page1部分吗?我查看了$ _SERVER数组,REQUEST_URI以?id = 3结尾.

I know how to access the id parameter using $_GET, however is there a way for me to access the #Page1 part? I have looked at the $_SERVER array and the REQUEST_URI ends at ?id=3.

我知道我也可以将#Page1更改为& Page = 1之类的附加参数,但是使用旧的URL类型有很多代码,我想避免重写(如果有的话)可能.

I know that I could also change the #Page1 to be an additional parameter like &Page=1, however there is a fair bit of code using the old URL type that I would like to avoid re-writing if at all possible.

感谢您的帮助.

推荐答案

不,没有办法.片段部分(#后面的标签)不会传输到服务器.

No, there isn't a way. The fragment part (the label after #) is not transmitted to the server.

浏览器检索文档 http://power-coder.net/Test/something.php?id=3 ,然后转到文档中的正确锚点(如果有).

The browser retrieve the document http://power-coder.net/Test/something.php?id=3 and then go to the correct anchor (if there is one) in the document.

这篇关于是否可以通过PHP访问查询字符串中的锚点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆