【发布时间】:2011-06-01 17:48:05
【问题描述】:
可能重复:
How to get the value after the hash in “somepage.php#name”?
是否可以使用 PHP 获得锚名称?
例如,对于这个 URL:
http://domain.com/#departments
我怎样才能得到文本“部门”?
【问题讨论】:
可能重复:
How to get the value after the hash in “somepage.php#name”?
是否可以使用 PHP 获得锚名称?
例如,对于这个 URL:
http://domain.com/#departments
我怎样才能得到文本“部门”?
【问题讨论】:
php中“#”后面的东西是没有办法获取的,因为这个数据不提供给服务器,只有url没有“#”后面的数据,但是如果你是通过JavaScript执行php脚本,可以一直拆分url放入“#”并将数据作为参数或某个隐藏字段的值发送。
【讨论】: