Retrieve page anchors via PHP?
- Pilot-Doofy
-
Pilot-Doofy
- Member since: Sep. 13, 2003
- Offline.
-
- Send Private Message
- Browse All Posts (12,142)
- Block
-
- Forum Stats
- Member
- Level 37
- Musician
I was wondering, is it possible to retrieve page anchors via PHP? I've tried $_SERVER['REQUEST_URI'] and PHP_SELF and even the __FILE__ constant. Here's what I'm wanting to do.
Say someone accesses index.php#forums
I want to be able to see that they have #forums at the end of the URL. Is there anyway to retrieve anchors in this way? A javascript alternative or really anything would be alright as well.
- eWhabs
-
eWhabs
- Member since: May. 4, 2006
- Offline.
-
- Forum Stats
- Member
- Level 13
- Blank Slate
Maybe take the address and explode it with the # sign and check if the second var of the array is empty?
-Disregard females (fuck bitches)
-Acquire currency (get money)
-Ignite cannabis frequently (smoke sum with your homies)
- JeremysFilms
-
JeremysFilms
- Member since: Feb. 18, 2005
- Offline.
-
- Forum Stats
- Member
- Level 18
- Blank Slate
At 1/11/07 07:11 PM, eWhabs wrote: Maybe take the address and explode it with the # sign and check if the second var of the array is empty?
Yeah, just do that... what's the significance of using those other methods?
- cherries
-
cherries
- Member since: Jun. 7, 2005
- Offline.
-
- Forum Stats
- Member
- Level 18
- Blank Slate
Well if your doing what I think your doing you could just use htaccess:
Options +FollowSymLinks
RewriteEngine On
RewriteRule \#+(.*)$ http://www.website.com/index.php?id=forums?=$ 1 [L]
Are you doing that?
- DFox
-
DFox
- Member since: Aug. 9, 2003
- Offline.
-
- Forum Stats
- Member
- Level 30
- Blank Slate
At 1/11/07 07:13 PM, JeremysFilms wrote:At 1/11/07 07:11 PM, eWhabs wrote: Maybe take the address and explode it with the # sign and check if the second var of the array is empty?Yeah, just do that... what's the significance of using those other methods?
But you can't get that current URL with PHP... PHP is server side, and anchors are tacked on on the client side.
The only thing that comes to mind for me is this: http://www.eggheadcafe.com/articles/20020107. asp
- Pilot-Doofy
-
Pilot-Doofy
- Member since: Sep. 13, 2003
- Offline.
-
- Send Private Message
- Browse All Posts (12,142)
- Block
-
- Forum Stats
- Member
- Level 37
- Musician
lol duh!
I can just use window.location and pass it to a PHP page for all the manipulation. Easy enough eh? Thank God for my new Ajax book!


