actual url ?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Yang Li Ke

    actual url ?

    I am searching for a function which would return the exact
    url where the script is actually being executed ?

    like http://www.mydomain.com/scripts/this_script.php

    Anyone can help?
    --
    Yang


  • rostik

    #2
    Re: actual url ?

    "Yang Li Ke" <yanglike@sympa tico.ca> wrote in message
    news:21ZUb.1278 7$ZN1.699713@ne ws20.bellglobal .com...[color=blue]
    > I am searching for a function which would return the exact
    > url where the script is actually being executed ?
    >
    > like http://www.mydomain.com/scripts/this_script.php[/color]



    $_SERVER['HTTP_HOST'].$PHP_SELF



    Comment

    • R. Rajesh Jeba Anbiah

      #3
      Re: actual url ?

      "Yang Li Ke" <yanglike@sympa tico.ca> wrote in message news:<21ZUb.127 87$ZN1.699713@n ews20.bellgloba l.com>...[color=blue]
      > I am searching for a function which would return the exact
      > url where the script is actually being executed ?
      >
      > like http://www.mydomain.com/scripts/this_script.php[/color]

      print_r($_SERVE R);

      And see, how can you get it...

      --
      "Success = 10% sweat + 90% tears"
      Email: rrjanbiah-at-Y!com

      Comment

      • Geoff Berrow

        #4
        Re: actual url ?

        I noticed that Message-ID: <c020h8$2qmd$1@ news.ntu-kpi.kiev.ua> from
        rostik contained the following:
        [color=blue][color=green]
        >> like http://www.mydomain.com/scripts/this_script.php[/color]
        >
        >
        >
        >$_SERVER['HTTP_HOST'].$PHP_SELF[/color]

        $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'] surely?
        --
        Geoff Berrow (put thecat out to email)
        It's only Usenet, no one dies.
        My opinions, not the committee's, mine.
        Simple RFDs http://www.ckdog.co.uk/rfdmaker/

        Comment

        • Tim Tyler

          #5
          Re: actual url ?

          Geoff Berrow <blthecat@ckdog .co.uk> wrote or quoted:[color=blue]
          > rostik contained the following:[/color]
          [color=blue][color=green][color=darkred]
          > >> like http://www.mydomain.com/scripts/this_script.php[/color]
          > >
          > >$_SERVER['HTTP_HOST'].$PHP_SELF[/color]
          >
          > $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'] surely?[/color]

          That returns the address of the URL of the page that originally
          called the script. The script may be in a different file
          with a different URL.
          --
          __________
          |im |yler http://timtyler.org/ tim@tt1lock.org Remove lock to reply.

          Comment

          • Geoff Berrow

            #6
            Re: actual url ?

            I noticed that Message-ID: <HsvEFA.L1w@bat h.ac.uk> from Tim Tyler
            contained the following:
            [color=blue][color=green][color=darkred]
            >> >$_SERVER['HTTP_HOST'].$PHP_SELF[/color]
            >>
            >> $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'] surely?[/color]
            >
            >That returns the address of the URL of the page that originally
            >called the script. The script may be in a different file
            >with a different URL.[/color]
            OK, gotcha.

            It's just that I've been working with pages that have query strings and
            $_SERVER['PHP_SELF'] doesn't show them.

            --
            Geoff Berrow (put thecat out to email)
            It's only Usenet, no one dies.
            My opinions, not the committee's, mine.
            Simple RFDs http://www.ckdog.co.uk/rfdmaker/

            Comment

            Working...