Content of the Browser Address Line

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ray Paseur

    Content of the Browser Address Line

    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:



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

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

    Thanks,
    ~Ray


  • Janwillem Borleffs

    #2
    Re: Content of the Browser Address Line

    Ray Paseur wrote:[color=blue]
    > 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_UR I"] /my_page.php?s=n
    >[/color]

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


    JW



    Comment

    • John Dunlop

      #3
      Re: Content of the Browser Address Line

      Ray Paseur wrote:
      [color=blue]
      > 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"[/color]

      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

      Comment

      • Ray Paseur

        #4
        Re: Content of the Browser Address Line

        Thanks, folks. I'll be looking for a book on JavaScript soon.

        "Ray Paseur" <ray@earplugsno n-aol.com> wrote in message
        news:kJaGd.2743 0$jn.14287@lake read06...[color=blue]
        > 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_UR I"] /my_page.php?s=n
        >
        > Thanks,
        > ~Ray
        >[/color]


        Comment

        Working...