PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
JellyFish
DevNet Resident
Posts: 1361 Joined: Tue Feb 14, 2006 7:18 pm
Location: San Diego, CA
Post
by JellyFish » Wed Apr 18, 2007 6:45 pm
It's simple. How can I return the URL's hash in php, like you can do in javascript via the 'window.location.hash' object?
In other words what's the "equivalent"?
Weirdan
Moderator
Posts: 5978 Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine
Post
by Weirdan » Wed Apr 18, 2007 6:55 pm
Is it ever sent to server actually?
JellyFish
DevNet Resident
Posts: 1361 Joined: Tue Feb 14, 2006 7:18 pm
Location: San Diego, CA
Post
by JellyFish » Wed Apr 18, 2007 7:03 pm
Not sure what you mean. If you mean is a hash always sent to the server through the URL, then that'd be a "no". How ever, I'll just do an if statement checking to see if the hash been sent.
Weirdan
Moderator
Posts: 5978 Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine
Post
by Weirdan » Wed Apr 18, 2007 7:16 pm
Although browsers usually do not send the hash part of the URL to the server, it would available in the $_SERVER['REQUEST_URI'] if it was sent.
JellyFish
DevNet Resident
Posts: 1361 Joined: Tue Feb 14, 2006 7:18 pm
Location: San Diego, CA
Post
by JellyFish » Wed Apr 18, 2007 7:54 pm
I don't understand. I'm not trying to be stupid...
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Wed Apr 18, 2007 9:24 pm
There is no equivalent to location.hash in PHP. You will have to parse the URI yourself.
JellyFish
DevNet Resident
Posts: 1361 Joined: Tue Feb 14, 2006 7:18 pm
Location: San Diego, CA
Post
by JellyFish » Thu Apr 19, 2007 4:15 pm
Okay cool. Thanks guys.