0

Ip address is considered to be unique identifier of local machine. But When proxy servers are used, then every machine using the proxy server uses the same ip address. Hence the $_SERVER[] variable just gives the same ip address for all the machines. I really needed a php function to capture the ipv4 address of the machine, if not anything unique will do. So that i can identify or differentiate between users accessing the site from different machine. Please help me.

danish
  • 3
  • 1

3 Answers3

0

Have you tried the php function get_browser ?

This is not able to differentiate user with 100% success but could be a real clue as it return a 26 item array.

http://php.net/manual/en/function.get-browser.php

zeropol
  • 146
  • 1
  • 6
0

What about setting a $_COOKIE http://php.net/manual/en/function.setcookie.php

setcookie("was_here", $_SERVER['REMOTE_ADDR'], strtotime('+1 year'));  /* expire after 1 year */
michalzuber
  • 5,079
  • 2
  • 28
  • 29
  • What a quick reply!!!! Suppose i set the cookie for a machine.. Then what? when the user again comes from that machine, will I be able to find him/her out?? If yes, how? – danish May 31 '13 at 10:54
  • http://www.w3schools.com/php/php_cookies.asp might be more what you are lookng for. – Robert Seddon-Smith May 31 '13 at 11:21
0

Could you use sessions or cookies? These can be used to differentiate between users.

http://php.net/manual/en/features.sessions.php

http://php.net/manual/en/features.cookies.php

Pudge601
  • 2,048
  • 1
  • 12
  • 11