This question already has an answer here:
I am writing a program to enable users to register domains. So when they make errors i receive an email notifying me about the errors a user has made. So i want the user's IP Address to be included also in the email. How can i collect it?
Thanks in advance
</div>
You can get the user’s IP address by using the $_SERVER['REMOTE_ADDR'] or $_SERVER['REMOTE_HOST'] variables.
You can get it by $_SERVER['REMOTE_ADDR']