By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,883 Members | 2,037 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,883 IT Pros & Developers. It's quick & easy.

Content of the Browser Address Line

P: n/a
Is there a way in PHP or JavaScript to determine the full content of the
browser address line, including the information that would tell us if the
link were to an internal part of a page? I'm trying to find the information
in a URL that looks like this:

http://www.mysite.com/my_page.php?s=n#detailed

The closest variable I can find does not include the "#detailed"

ENV["REQUEST_URI"] /my_page.php?s=n

Thanks,
~Ray
Jul 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Ray Paseur wrote:
Is there a way in PHP or JavaScript to determine the full content of
the browser address line, including the information that would tell
us if the link were to an internal part of a page? I'm trying to
find the information in a URL that looks like this:

http://www.mysite.com/my_page.php?s=n#detailed

The closest variable I can find does not include the "#detailed"

ENV["REQUEST_URI"] /my_page.php?s=n


As the hash can only be parsed client-side, the only way is to use the
location.hash javascript property.
JW

Jul 17 '05 #2

P: n/a
Ray Paseur wrote:
Is there a way in PHP or JavaScript to determine the full content of the
browser address line, including the information that would tell us if the
link were to an internal part of a page? I'm trying to find the information
in a URL that looks like this:

http://www.mysite.com/my_page.php?s=n#detailed

The closest variable I can find does not include the "#detailed"


A fragment identifier, what comes after the '#' in a URI-
reference, isn't sent to the server, so you can't access it
with PHP. When you enter a URI like that into the address
bar, the browser parses it and keeps the fragment identifier
for itself, to use once it has retrieved the resource.

In Javascript, however, consider the hash property of the
location object: location.hash. I'd consult c.l.javascript
though.

HAGW!

--
Jock
Jul 17 '05 #3

P: n/a
Thanks, folks. I'll be looking for a book on JavaScript soon.

"Ray Paseur" <ra*@earplugsnon-aol.com> wrote in message
news:kJaGd.27430$jn.14287@lakeread06...
Is there a way in PHP or JavaScript to determine the full content of the
browser address line, including the information that would tell us if the
link were to an internal part of a page? I'm trying to find the
information in a URL that looks like this:

http://www.mysite.com/my_page.php?s=n#detailed

The closest variable I can find does not include the "#detailed"

ENV["REQUEST_URI"] /my_page.php?s=n

Thanks,
~Ray

Jul 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.