How do you find the ip address of the user who's is in your website? What if there are multiple users?
Use the environment variable $_ENV['REMOTE_ADDR']. You don't need to worry about multiple users, because a process is created for each HTTP request, so each process will have its own environment variables.
Diego