Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 544805
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T10:41:39+00:00 2026-05-13T10:41:39+00:00

Possible Duplicates: How to obtain anchor part of URL after # in php Is

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T10:41:39+00:00Added an answer on May 13, 2026 at 10:41 am

    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

    document.location.hash
    

    or

    window.location.hash
    

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Obtain root access via su on the Android emulator Hi, I'm working
Possible Duplicate: Getting a FILE* from a std::fstream Is there a way to obtain
Possible Duplicates: how do I create my own URL protocol? (e.g. so://…) How do
Possible Duplicate: easiest way to parse xml in python I need to parse a
Possible Duplicate: Find and list duplicates in Python list I have this script in
Possible Duplicate: PHP iterate days of month given month and year Obtain all days
Possible Duplicate: bit twiddling: find next power of two How to obtain the next
Trying to find an efficient way to obtain the top N items in a
Possible Duplicates: Reference - What does this symbol mean in PHP? Should I use
Possible Duplicate: Getting Filename from file descriptor in C Obtain filename from file pointer

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.