1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

PHP invalid ip address

Discussion in 'PHP' started by l3l00, Mar 15, 2013.

  1. #1
    Okay so I got a lot of work done last night and it is going well so fare, trying to connect this cart to an API.

    so I have
    $ipaddress = urlencode($_SERVER['REMOTE_ADDR']);
    Code (markup):
    it shows in the debug report 127.0.0.1 but it then says it is wrong?

    &ipAddress=127.0.0.1resource(4) of type (stream) errorFound=1&responseCode=321&errorMessage=Invalid+IP+address+of+%28Malformed+IP+Address%29+found+
    Code (markup):
     
    l3l00, Mar 15, 2013 IP
  2. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #2
    REMOTE_ADDR is the IP address of the user. Is that what you want? (It looks like you're testing it locally.)
     
    Rukbat, Mar 15, 2013 IP
  3. innozemec

    innozemec Active Member

    Messages:
    84
    Likes Received:
    3
    Best Answers:
    1
    Trophy Points:
    68
    #3
    127.0.0.1 is your local compute's ip, thats why you might be getting that error
     
    innozemec, Mar 15, 2013 IP
  4. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,998
    Best Answers:
    253
    Trophy Points:
    515
    #4
    Uhm, can we see the code AFTER that. I don't think the code you posted is what's generating that error... No, that code does not and could not generate a type mismatch error. I think it's something AFTER it. (and this is why snippets are USELESS for diagnosing bugs).

    Yeah, the code you posted has absolutely NOTHING to do with that error -- we need to see the REST of it!
     
    deathshadow, Mar 16, 2013 IP