如何获得服务器端语言的散列? [英] How to get hash in a server side language?

查看:107
本文介绍了如何获得服务器端语言的散列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据我所知,没有办法在服务器端语言中获得URL哈希,因为哈希URL不会被发送到服务器端。我的一位同事告诉我应该可以在java(jsp)或Ruby中使用。由于我在PHP上测试过它,但它不起作用。我搜索了ruby和jsp,但没有运气。他还提到,第一次访问(http://domain.com/index.php#test)可以从服务器端访问。



在PHP中,打印我们的< $ _ $ SERVER 变量没有任何有关哈希的内容

这是否真的可以在其他服务器端语言中使用?


<解决方案

它被称为分片标识符,仅在客户端 - 浏览器不会将该部分URL发送到服务器。除非您使用某些浏览器实现(或软件),否则 会将该部分网址发送到服务器,否则无法使用任何语言。参考: http://en.wikipedia.org/wiki/Fragment_identifier


As far as I know, there's no way to get url hash in a server side language since hash urls are not being sent to the server side. One of my co-workers told me that it should be possible in java (jsp) or Ruby. Since I tested it on PHP, but it simply doesn't work. I googled about ruby and jsp, but had no luck. He also mentioned that the first access (http://domain.com/index.php#test ) is accessible from a server side.

in PHP, printing our $_SERVER variable doesn't have anything about hash

Is this really possible in other server side languages?

解决方案

Short answer: no, it's a client side only thing.

Slightly longer: It's called Fragment identifier and is client side only - browser doesn't send that part of the url to the server. It's not possible in any language unless you are using some browser implementation (or software) which would send that part of url to the server. Reference: http://en.wikipedia.org/wiki/Fragment_identifier

这篇关于如何获得服务器端语言的散列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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