Possible Duplicates:
How to obtain anchor part of URL after # in php
Is it possible to access anchors in a querystring via PHP?
i need to find a way to do this, facebook does it so it has to be possible….
If a user goes to this URL in the browser
http://localhost/index.php?photos=p#12345
Then I can have my PHP load a photo with the ID 12345 from mysql
If a user went to
http://localhost/index.php?photos=p#123456
Then it would load a photo with id 123456
I just need help in getting the value in the URL after the # and accessing it with PHP if possible? IF it is not possible, then I maybe I can access it with jQuery and then make an AJAX call to load an image based on this value.
So does anyone know how I can get that value?
You can only access this value with Javascript as it is never sent to the server, so PHP never gets it. As Kenny said, you can access it with
or
but you cannot access it with PHP.
Facebook is a very heavy Javascript site actually. You probably want to do something like send an AJAX request for picture/comment data immediately when the page is loaded. Then when someone presses the ‘next’ button, you do another request.