ip address question (trouble with remote_addr)

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

    ip address question (trouble with remote_addr)

    Hi.
    I have a problem when I use the $_SERVER['remote_addr'].
    I'm testing a script, and the strange thing is that remote_addr returns an
    ip-address only sometimes, and not always. Why can that be?
    Are there any other (better) methods of getting the ip-address?

    Ojorus


  • Erwin Moller

    #2
    Re: ip address question (trouble with remote_addr)

    ojorus wrote:
    [color=blue]
    > Hi.
    > I have a problem when I use the $_SERVER['remote_addr'].
    > I'm testing a script, and the strange thing is that remote_addr returns an
    > ip-address only sometimes, and not always. Why can that be?
    > Are there any other (better) methods of getting the ip-address?
    >
    > Ojorus[/color]

    Hi Ojorus,

    That is suprising because that IP is used to send the response to.
    Can you reproduce the empty $_SERVER['remote_addr'] yourself?

    What setup are you using? PHP-version/OS/webserver?

    Regards,
    Erwin Moller

    Comment

    • Erwin Moller

      #3
      Re: ip address question (trouble with remote_addr)

      Erwin Moller wrote:
      [color=blue]
      > ojorus wrote:
      >[color=green]
      >> Hi.
      >> I have a problem when I use the $_SERVER['remote_addr'].
      >> I'm testing a script, and the strange thing is that remote_addr returns
      >> an ip-address only sometimes, and not always. Why can that be?
      >> Are there any other (better) methods of getting the ip-address?
      >>
      >> Ojorus[/color]
      >
      > Hi Ojorus,
      >
      > That is suprising because that IP is used to send the response to.
      > Can you reproduce the empty $_SERVER['remote_addr'] yourself?
      >
      > What setup are you using? PHP-version/OS/webserver?[/color]

      One addition: according to

      both IIS and Apache support remote_adres.
      [color=blue]
      >
      > Regards,
      > Erwin Moller[/color]

      Comment

      • ojorus

        #4
        Re: ip address question (trouble with remote_addr)

        Hi!
        The server where the php-script is located is Apache/1.3.33. (Shared host)
        X-Powered-By: PHP/5.0.4

        When I test the script locally on my apache-installation, everything works
        fine. But when I upload it to the server I use, the strange error occour;
        the IP-address is only returned from time to time, and not always.
        It also seems that when the server is quite busy, the problem increases.

        I don't have a clue how to solve this...

        Ojorus

        "Erwin Moller"
        <since_humans_r ead_this_I_am_s pammed_too_much @spamyourself.c om> skrev i
        melding news:4480128f$0 $31655$e4fe514c @news.xs4all.nl ...[color=blue]
        > ojorus wrote:
        >[color=green]
        >> Hi.
        >> I have a problem when I use the $_SERVER['remote_addr'].
        >> I'm testing a script, and the strange thing is that remote_addr returns
        >> an
        >> ip-address only sometimes, and not always. Why can that be?
        >> Are there any other (better) methods of getting the ip-address?
        >>
        >> Ojorus[/color]
        >
        > Hi Ojorus,
        >
        > That is suprising because that IP is used to send the response to.
        > Can you reproduce the empty $_SERVER['remote_addr'] yourself?
        >
        > What setup are you using? PHP-version/OS/webserver?
        >
        > Regards,
        > Erwin Moller[/color]


        Comment

        • Gordon Burditt

          #5
          Re: ip address question (trouble with remote_addr)

          >I have a problem when I use the $_SERVER['remote_addr'].[color=blue]
          >I'm testing a script, and the strange thing is that remote_addr returns an
          >ip-address only sometimes, and not always. Why can that be?
          >Are there any other (better) methods of getting the ip-address?[/color]

          Some IP addresses have no reverse DNS. If it's intermittent for
          the SAME IP address on different hits, maybe you're having trouble
          with DNS lookups.

          Gordon L. Burditt

          Comment

          Working...