Jump to content

Recommended Posts

Hey guys,

 

I'm dealing a url that is similar to hxxp://domain/directory/?#{$id}.

 

What I'm trying to do is extract $id from that.  Its not available as a $_GET variable and $_SERVER['REQUEST_URI'] comes up as "/directory/?".

 

Does anyone know how I could retrieve $id ?

 

Thanks

 

 

 

Is this the URL to the page that you are on and you're trying to get it?  If so, then this is a clumsy way of doing it.  The # is causing problems because it's a fragment separator for bookmarks etc in the browser.  What are you hoping to get?

It is the URL of the page that I'm on.  Agreed its not the best URL format but its what the application and I am working with.

 

Its to link directly to a specific part of a page, however, I need to be able to detect what part that is.

 

Any suggestions ?

It is the URL of the page that I'm on.  Agreed its not the best URL format but its what the application and I am working with.

 

Its to link directly to a specific part of a page, however, I need to be able to detect what part that is.

 

Any suggestions ?

 

That fragment is only meaningful to the browser, so if you can't change the format of the URL, then you probably need to look at javascript.

 

Or if you can use mod rewrite on Apache you can rewrite the URL so that the server passes the value to PHP:

 

/?#1 becomes: /?id=1#1 for example.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.