Need some help with gethostbyaddr

Discussion in 'PHP' started by netpants, Jun 7, 2008.

  1. #1
    Getting this warning
    Warning: gethostbyaddr() [function.gethostbyaddr]: Address is not a valid IPv4 or IPv6 address in /home/mobsters/public_html/signup.php on line 312
    
    Code (markup):
    Line 312 is
    $host=gethostbyaddr("$REMOTE_ADDR");
    Code (markup):
    Anyone know what it could be?
     
    netpants, Jun 7, 2008 IP
  2. Rob Whisonant

    Rob Whisonant Well-Known Member

    Messages:
    156
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    110
    #2
    $_SERVER['REMOTE_ADDR']

    Re's
    Rob Whisonant
     
    Rob Whisonant, Jun 7, 2008 IP
  3. Karin_Elliott

    Karin_Elliott Peon

    Messages:
    28
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Just to clarify Rob's response:

    echo getHostByAddr($_SERVER['REMOTE_ADDR']);
     
    Karin_Elliott, Jun 7, 2008 IP
  4. EricBruggema

    EricBruggema Well-Known Member

    Messages:
    1,740
    Likes Received:
    28
    Best Answers:
    13
    Trophy Points:
    175
    #4
    But check out the REMOTE_ADDR some sites/proxy will give another not valid ip address!
     
    EricBruggema, Jun 8, 2008 IP