Php to get value of hash from URL

前端 未结 3 772
遇见更好的自我
遇见更好的自我 2020-12-11 20:50

How can I get a variable of a hash in php.

I have a variable on page like this

catalog.php#album=2song=1

How can i get the album an

3条回答
  •  暖寄归人
    2020-12-11 21:09

    You can't get this value with PHP because PHP processes things server-side, and the hash in the URL is client-side only and never gets sent to the server. JavaScript can get the hash though, using window.location.hash (and optionally call on a PHP script including this information, or add the data to the DOM).

提交回复
热议问题