从PHP中的url获取# [英] get a # from a url in php
问题描述
我正在尝试用facebook API编码
这里说: http://developers.facebook.com/docs/authentication/javascript
获取access_token的东西,但它是在#而不是? p>
所以我该怎么办?
http://www.example.com/callback#access_token=...&expires_in= ...
您将无法在PHP中执行此操作 - 您只能在javascript中访问它 - 片段/哈希从不到达服务器,它在Javascript中由浏览器
处理,您可以使用
window.location.hash
I'm trying to code with the facebook API
here it says : http://developers.facebook.com/docs/authentication/javascript to get the access_token thing, but it's after a # and not a ?
so how can I get it ?
http://www.example.com/callback#access_token=...&expires_in=...
You won't be able to do it in PHP - you can only access it in javascript - the fragment/hash never reaches the server, it is processed by the browser
in Javascript, you can access the fragment using
window.location.hash
这篇关于从PHP中的url获取#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!