How To Determine The Ip Of A Visitor

Table of contents:

How To Determine The Ip Of A Visitor
How To Determine The Ip Of A Visitor
Anonim

Sometimes you need to find out who, when, from which ip-address visited your Internet resource. Such detailed information can be obtained by installing the simplest scripts on the page of your site.

How to determine the ip of a visitor
How to determine the ip of a visitor

It is necessary

  • - PC with Windows operating system installed;
  • - access to the Internet.

Instructions

Step 1

Use a free traffic counter for Internet resources. Follow the link https://gostats.ru/, find out information about who visited your site and study the data provided. Install the counter code on your site and get the necessary information about the users who visited your resource. You can use the services of the service located at https://iplogger.ru/, which has similar characteristics. But in this case, there is no guarantee that the link added to the website will not lead to an unscrupulous sniffer that steals confidential information from users.

Step 2

If you do not trust third-party services, organize and organize the accounting of the ip-addresses of your site visitors directly on it. Paste on the page, after the closing tag / html, the code:

$ ip = getenv ("REMOTE_ADDR");

$ date = date ("d M Y, H: i: s");

$ agent = getenv ("HTTP_USER_AGENT");

$ str = ("

Data - $ date

Ip - $ ip

Browser - $ agent

------- );

$ log = fopen ("base.php", "a +");

fwrite ($ log, "\ n $ str / n");

fclose ($ log);

?>

and find out who visited your site.

Step 3

With the help of this code, written in PHP, you will find out about the time of visiting your site. Get information about the web browser used by the guest and its ip-address. All this data is written in the base.php text file. To create it, open Notepad, activate an empty text file in it and save it in the form base.txt. In the file name, replace the txt extension with php and place it in the root directory. Enter in your browser: _https://your_site_address/base.php and check who visited your site. To make information from a file with reports confidential, enter the line in its form: “You do not have access to this file”; exit; ?> ".

Recommended: