Get Anchors in the URL from GETENV?

I understand GETENV('REQUEST_URI') returns the URL provided to access the current .php page.  However, how do I retrieve the anchors?  i.e.

http://somedomain.com/#someanchor

REQUEST_URI does not include the #someanchor.  What's the simple way of finding the anchors?

LVL 1
segmentalfaultAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Diablo84Commented:
I don't think you can, bookmarks are handled on the client side by the browser so the anchor information is never sent to the server.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ldbkuttyCommented:
yes, though like this is possible:

<?php
   print_r(parse_url('http://localhost:81/tests/test.php?something=23#hai'));
?>

but you cannot use it for 'relative' URL.
0
Diablo84Commented:
Good idea ldbkutty, though as you say anything relative wont work as there is no request to the server.
0
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

ldbkuttyCommented:
Anything after # is said to be a fragment identifier and IT is not consiered as a part of the URL.
0
eeBlueShadowCommented:
You can see exactly what variables are availble by making a phpinfo() page called, for example phpinfo.php and then visiting http://www.yoursite.com/phpinfo.php?someGet=info#anchoir
0
gruntarCommented:
U can't... sorry

Anchoir is internal browser variable and is not sent to server.
0
Diablo84Commented:
When this is handled by cleanup could the accepted answer either be changed to ldbkutty {http:#12550692} - this is the nearest thing there is to getting the anchor server side - or can the accepted answer be removed from my comment. I do not particularly want a C grade in my profile. Thank you :)
0
segmentalfaultAuthor Commented:
If you're worried about it, the admin can change it to A.  I just figured the answer wasn't worth an A grade.  But after reviewing the possible answers, there probably wasn't much to go on anyhow.

0
Diablo84Commented:
segmentalfault, its not a problem i just i don't really want a C grade in my profile. Sometimes answers are not the answer you wanted to hear, particularly in the case of "not possible" situations, but in these cases if it's not possible the answer can't go into much more detail other then the fact that’s it can't be done and why it can't be done. In this case its a limited one because anchors are handled client side for the best part.

I see your point though, this isn't much of an A grade question/answer combination so perhaps a B will be more fitting. I will have CS take a look at it. Thank you for your co-operation.
0
segmentalfaultAuthor Commented:
Absolutely, I'll second the motion to change it to an A grade after reviewing the possibilities again.

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.