Вопрос

I want to know how to get the IP address of visitors to my site. I will then put this into an SQL table that will count how many times they visit. I know PHP, JavaScript, HTML, and MySQL so I just need to know what the code for getting a viewer's IP is, I can code the rest myself.

Thanks in advance for the help.

Это было полезно?

Решение

You can get the user's IP address by accessing the $_SERVER array:

 echo $_SERVER['REMOTE_ADDR'];

Другие советы

Just look in the $_SERVER variable.

That should have all the info you need.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top