You can put the code in two ways inside the page you want to record the incoming IP's.
Depending on the type of file, select the first option if your page is PHP
or the second option if your page is HTML.
In the first case of PHP copy the file IpLogger.php to the same folder as the file you pasted the
code.
Otherwise in the second case of HTML copy the file IpLogger.php and the file
IpLoggerApi.php in
the same folder as the file where you pasted the JavaScript code.
body tag.
<?php
require_once "./IpLogger.php";
$logger = new IpLogger();
$logger->write('ipsLog.txt', 'Europe/Athens');
?>
<script>
CallIpLogger();
function CallIpLogger() {
let xhttp = new XMLHttpRequest();
let url = "IpLoggerApi.php";
xhttp.open("GET", url, true);
xhttp.send();
}
</script>