1

I'm using $_SERVER[REMOTE_ADDR] to keep audit of unsecured pages (without login). Somehow from last two days it's behaving bit wierd.

Ex: If I access unsecured page, IP address which is inserted is having location at least 3000 Km's from my location (In fact outside the country from which I'm accessing). Note: I'm finding out ip address location using URL: http://whatismyipaddress.com/

Can you please help me to understand this?

Sample code is mentioned below

INSERT INTO LOG_TABLE (SEQUENCE_ID,IP_ADDRESS, C_DATE) VALUES (NULL,'$_SERVER[REMOTE_ADDR]',NOW()) 
Pawan Mude
  • 1,609
  • 6
  • 19
  • 32
  • Is it the correct IP? IP geolocation services are not always reliable. – Barmar Nov 03 '13 at 08:49
  • Are you sure it's not your own ip address? Are you using a reverse proxy? – tlenss Nov 03 '13 at 08:49
  • @Barmar ; No IP is not correct. It's different from the one given by whatismyipaddress.com – Pawan Mude Nov 03 '13 at 09:00
  • @tlenss ; yes i'm sure, its not my own ip address. I'm not using any proxy. – Pawan Mude Nov 03 '13 at 09:00
  • Show us some code... `REMOTE_ADDR` should always contain the requesting side's IP – tlenss Nov 03 '13 at 09:02
  • Are you sure the log message is for your connection, not someone coming from that other address? – Barmar Nov 03 '13 at 09:04
  • possible duplicate of [suddenly $\_SERVER\['REMOTE\_ADDR'\] is started returning 10.10.10.10 php](http://stackoverflow.com/questions/4966369/suddenly-serverremote-addr-is-started-returning-10-10-10-10-php) – tlenss Nov 03 '13 at 09:12
  • @tlenss I've added MySQLi statement which i'm calling from PHP – Pawan Mude Nov 03 '13 at 10:25
  • @"Downvoter" : This Question is not a duplicate of the marked question. There are two answers mentioned , if you can clarify on second answer, it'll be very much useful. – Pawan Mude Nov 03 '13 at 10:40

0 Answers0