PHP & using #tags in the URL

Ok I am not a PHP expert. I have been JR developer in PHP for many years but never got beyond that. So I am warning you ahead of time about that.

all the URLs below are bogus made up ones. They may or may not actually resolve to a page.

if I want to go to a webpage you just use the URL (e.g. http://nocturnalcodingmonkeys.com/ or http://nocturnalcodingmonkeys.com/EULA.html ). Not a big deal. Really easy.

If I want to go to a specific section/div of a page you just use the URL#tag (e.g. http://nocturnalcodingmonkeys.com/#services or http://nocturnalcodingmonkeys.com/privacy.html#section3 ). Not a big deal.

now if I want to do it with PHP that is also pasing parameters is what I am failing.
http://nocturnalcodingmonkeys.com/contact.php?name=bob&job=guru works well for passing parameters.
but I cant find a way (it is escaping me right now and my google-fu is failing me) to do something like http://nocturnalcodingmonkeys.com/contact.php#mail?name=bob&job=guru or http://nocturnalcodingmonkeys.com/contact.php?name=bob&job=guru#mail or something.

I know it is fairly easy to do. brain is just baked right now.

thanks!
sb

It would be the second one. Jumping to tags in the document using a # symbols is a browser function, so it shouldn’t require any PHP at all. I thought it was automatic, but I haven’t used any section jumping like that in a serious way ever. Maybe store $name and $job in the $_SESSION instead of $_GET?

For better or worse, the anchor is never sent to the server. If you want to get at it server-side, you need to use JavaScript to send the anchor via AJAX, or something similar.

And yes, the anchor comes after the query parameters.

Tim & Thom thank you!!!

that is what I was doing wrong.
1 step closer to re-launching the corp website.
99 more steps to go.