My system is continuously recording data without control from it ip
.
How can I make it so that ip
it does not register data again, unless 48 hours have passed for it to register again?
I understand that from a previous query, the last inserted data must be obtained:
SELECT visitor_ip FROM visitors_table ORDER BY visitor_date DESC LIMIT 1
But how do I validate it, if the 48 hours have not yet passed that you do not insert data and if the 48 hours have already passed, your data must be re-registered.
<?php
require_once('visitors_connections.php');
$visitor_ip = GetIP();
$visitor_browser = getBrowserType($_SERVER['HTTP_USER_AGENT']);
$visitor_date = date("Y-m-d H:i:s");
$visitor_refferer = $refferer;
$visited_page = selfURL();
$stmt = $con->prepare("INSERT INTO visitors_table (visitor_ip, visitor_browser, visitor_date,
visitor_refferer, visitor_page) VALUES (?, ?, ?, ?, ?)");
$stmt->bind_param("sssss", $visitor_ip,$visitor_browser,$visitor_date,$visitor_refferer,$visited_page);
$stmt->execute();
?>