URL/URI than called the script ?

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

    URL/URI than called the script ?


    Hi is there a way of a php script knowing what page/script/object/thing
    on the server called it ? I don't mean the referer in the user's
    browser which is easily spoofed or non-existant I mean is it possible
    for a PHP script to be 'aware' of what other page within the site is
    accessing it ? I think $HTTP_REFERER is out, is there anything else
    that would help ?

    Thanks

    j
  • Daniel Tryba

    #2
    Re: URL/URI than called the script ?

    j <j@j.j> wrote:[color=blue]
    > I mean is it possible for a PHP script to be 'aware' of what other
    > page within the site is accessing it ?[/color]

    Take a look at the $_SERVER variable. The variable you are looking for
    is in there.

    --

    Daniel Tryba

    Comment

    • FLEB

      #3
      Re: URL/URI than called the script ?

      Regarding this well-known quote, often attributed to j's famous "Sat, 01
      May 2004 08:16:40 +0100" speech:
      [color=blue]
      > Hi is there a way of a php script knowing what page/script/object/thing
      > on the server called it ? I don't mean the referer in the user's
      > browser which is easily spoofed or non-existant I mean is it possible
      > for a PHP script to be 'aware' of what other page within the site is
      > accessing it ? I think $HTTP_REFERER is out, is there anything else
      > that would help ?
      >
      > Thanks
      >
      > j[/color]

      I suppose you could register a session, then have every page set a "Last
      Page Viewed" session variable. It would involve recoding all your pages,
      but if you make it a standard include, you could do that easily.

      --
      -- Rudy Fleminger
      -- sp@mmers.and.ev il.ones.will.bo w-down-to.us
      (put "Hey!" in the Subject line for priority processing!)
      -- http://www.pixelsaredead.com

      Comment

      • j

        #4
        Re: URL/URI than called the script ?

        In article <mg5ijpt8gy2p$. tyum8djorfyn$.d lg@40tude.net>, FLEB
        <soon.the.sp@mm ers.and.evil.on es.will.bow-down-to.us> wrote:

        [color=blue]
        > I suppose you could register a session, then have every page set a "Last
        > Page Viewed" session variable. It would involve recoding all your pages,
        > but if you make it a standard include, you could do that easily.[/color]

        OK i'll look into it. Thanks for the info

        j

        Comment

        • j

          #5
          Re: URL/URI than called the script ?

          In article <c708j8$g78$2@n ews.tue.nl>, Daniel Tryba
          <news_comp.lang .php@canopus.nl > wrote:
          [color=blue]
          > j <j@j.j> wrote:[color=green]
          > > I mean is it possible for a PHP script to be 'aware' of what other
          > > page within the site is accessing it ?[/color]
          >
          > Take a look at the $_SERVER variable. The variable you are looking for
          > is in there.[/color]

          Hmm, i had a look but could not find. thanks though
          j

          Comment

          • Daniel Tryba

            #6
            Re: URL/URI than called the script ?

            j <j@j.j> wrote:[color=blue][color=green]
            >> Take a look at the $_SERVER variable. The variable you are looking for
            >> is in there.[/color]
            >
            > Hmm, i had a look but could not find. thanks though[/color]

            I thought you were looking for info about where a file was included. I
            reread your qyestion and guess you beed a "secure" referrer. Since
            anyrhing passed by the client is not considdered secure, hiw about about
            a session array of requested pages. Unless the client ysed its
            "backbutton " the last entry in the array called the current url.

            --

            Daniel Tryba

            Comment

            Working...