PHP & Hash / Fragment Portion of URL

前端 未结 5 864
北恋
北恋 2020-12-03 08:42

I am trying to find a way to save the hash portion of a url and as a PHP variable. This idea is a bit kooky, but bear with me...

I\'d like to extract the \"location

5条回答
  •  误落风尘
    2020-12-03 09:23

    The Fragment is never sent to the server, according to this thread on the Mod_Rewrite forums. So, this might be impossible unless you use AJAX to change the page after the fact.

    Another idea would be to have Javascript turn the hash into a $_GET paramater, and then refresh the page.

提交回复
热议问题