How to return url with Anchor in it?

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

Post Reply
petermorrisr7
Forum Newbie
Posts: 2
Joined: Fri Aug 07, 2009 7:42 am

How to return url with Anchor in it?

Post by petermorrisr7 »

Hi,
I've looked at superglobals, globals, and anywhere else I can think of - still can't find what I need:
I'm trying to differentiate between the urls used to call my php page. $_GET values are not a problem, but I can't figure out any way to retrieve the calling url if it looks like this:
http://www.myserver.com/superduperpage.php#Z
All the global variables seem to strip off the #Z part. Does anyone know how I can retrieve the entire url used? (I'm sure I'm missing something pretty basic here!)
Thanks,
Peter
Mark Baker
Forum Regular
Posts: 710
Joined: Thu Oct 30, 2008 6:24 pm

Re: How to return url with Anchor in it?

Post by Mark Baker »

I'm not sure that you can. the # (internal target) part of the URL is handled within the browser itself, and I don't believe it's ever sent to the server by any of the popular browsers
petermorrisr7
Forum Newbie
Posts: 2
Joined: Fri Aug 07, 2009 7:42 am

Re: How to return url with Anchor in it?

Post by petermorrisr7 »

Thanks Mark - that makes sense- of course the client takes it off...
I'll have to go back to the drawing board!
-Peter
peterjwest
Forum Commoner
Posts: 63
Joined: Tue Aug 04, 2009 1:06 pm

Re: How to return url with Anchor in it?

Post by peterjwest »

You might be able to get it with javascript and send a separate request to the server, might.

Edit: try this:
http://www.wacdesigns.com/2008/01/16/re ... -from-url/
Post Reply