Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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 and song values and put them into PHP variables?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
178 views
Welcome To Ask or Share your Answers For Others

1 Answer

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).


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...