egregious;11010933 wrote:I would like to track the IP of users who access my website and store them in my MYSQL database.
Why? Surely whichever application you're using as your webserver daemon (Apache's HTTPD, for example) already has this ability. Why not simply utilize (perhaps after enabling/properly configuring) these existing access logs rather than trying to reinvent the wheel?
egregious;11010933 wrote:I tried many codes and tested it myself. But all it shows is the IP address of the manual proxy server and not the IP address of the Ethernet local area connection of the users
That would suggest they aren't accessing your computer directly and are instead getting routed to the proxy server (which, in turn, makes a request to your computer on behalf of a remote user, relaying the response after it receives it). There are a number of reasons why this could be happening, including browser restrictions and/or network security rules, some of which may not be within your realm (or the user's) to change.
Then again, unless you know for a fact you're on a network that is very well secured and monitored, IP addresses can be spoofed (and/or manually specified/changed as desired), so YMMV if you expect them to be a good metric for tracking individual users. Plus, even if you managed to get an IP address other than that of the proxy server, who's to say that multiple users aren't sharing that same IP address (such as the case would be behind a wireless router with NAT capabilities)?