Users IP on PHP3?

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

    Users IP on PHP3?


    I have a project and PHP 3.0.12 is installed...red iculous I know, but its
    not my fault.

    what is the syntax for getting the visiting users IP? Nothing I try seems to
    work.

    Thanks in Advance,
    Karl


  • Martin Buchleitner

    #2
    Re: Users IP on PHP3?

    * "Karl Hungus" <nnnnndddddd@ho tmail.com> wrote:
    [color=blue]
    > I have a project and PHP 3.0.12 is installed...red iculous I know, but its
    > not my fault.
    >
    > what is the syntax for getting the visiting users IP? Nothing I try seems to
    > work.[/color]


    It is availeable in
    $_SERVER[REMOTE_HOST]


    martin

    --
    Are you Anonymous? Where? ... I don't think so ...

    [ devnull{at}chao sfactory{dot}or g | http://www.chaosfactory.org/ ]

    Comment

    • Pedro Graca

      #3
      Re: Users IP on PHP3?

      Karl Hungus wrote:[color=blue]
      > I have a project and PHP 3.0.12 is installed...red iculous I know, but its
      > not my fault.
      >
      > what is the syntax for getting the visiting users IP? Nothing I try seems to
      > work.[/color]

      Try
      $_SERVER['REMOTE_ADDR']

      But, that can be the IP address of the proxy they use.

      If I were to go to your page you'd get the same address as anybody else
      coming from the same city and provider I'm in -- the address of our
      provider &^##$^% http-proxy!
      --
      --= my mail box only accepts =--
      --= Content-Type: text/plain =--
      --= Size below 10001 bytes =--

      Comment

      • Karl Hungus

        #4
        Re: Users IP on PHP3?


        $_SERVER will not work on php3 at all.

        "Note: Introduced in 4.1.0. In earlier versions, use $HTTP_SERVER_VA RS"

        http_server_var s doesnt work either

        [color=blue]
        > Try
        > $_SERVER['REMOTE_ADDR']
        >
        > But, that can be the IP address of the proxy they use.
        >
        > If I were to go to your page you'd get the same address as anybody else
        > coming from the same city and provider I'm in -- the address of our
        > provider &^##$^% http-proxy!
        > --
        > --= my mail box only accepts =--
        > --= Content-Type: text/plain =--
        > --= Size below 10001 bytes =--[/color]


        Comment

        • Andy Hassall

          #5
          Re: Users IP on PHP3?

          On Wed, 25 Feb 2004 23:26:41 +0100, Martin Buchleitner
          <devnull@chaosf actory.org> wrote:
          [color=blue]
          >* "Karl Hungus" <nnnnndddddd@ho tmail.com> wrote:
          >[color=green]
          >> I have a project and PHP 3.0.12 is installed...red iculous I know, but its
          >> not my fault.
          >>
          >> what is the syntax for getting the visiting users IP? Nothing I try seems to
          >> work.[/color]
          >
          >It is availeable in
          > $_SERVER[REMOTE_HOST][/color]

          No it isn't.

          --
          Andy Hassall <andy@andyh.co. uk> / Space: disk usage analysis tool
          <http://www.andyh.co.uk > / <http://www.andyhsoftwa re.co.uk/space>

          Comment

          • Andy Hassall

            #6
            Re: Users IP on PHP3?

            On Wed, 25 Feb 2004 22:23:47 GMT, "Karl Hungus" <nnnnndddddd@ho tmail.com>
            wrote:
            [color=blue]
            >I have a project and PHP 3.0.12 is installed...red iculous I know, but its
            >not my fault.
            >
            >what is the syntax for getting the visiting users IP? Nothing I try seems to
            >work.[/color]

            Hm, even 'get_defined_va rs' doesn't work way back in PHP3.

            Is there anything in the output of phpinfo() you could work with? Is
            $REMOTE_ADDR set as a global variable?

            --
            Andy Hassall <andy@andyh.co. uk> / Space: disk usage analysis tool
            <http://www.andyh.co.uk > / <http://www.andyhsoftwa re.co.uk/space>

            Comment

            • Karl Hungus

              #7
              Re: Users IP on PHP3?


              Yeah, I can use the global variables. thanks.


              [color=blue]
              > Is there anything in the output of phpinfo() you could work with? Is
              > $REMOTE_ADDR set as a global variable?
              >
              > --
              > Andy Hassall <andy@andyh.co. uk> / Space: disk usage analysis tool
              > <http://www.andyh.co.uk > / <http://www.andyhsoftwa re.co.uk/space>[/color]


              Comment

              Working...