Added the Analytics Page to the webpage

This commit is contained in:
lukejelse04
2021-03-22 08:44:26 +00:00
parent d15b16bc63
commit c9804abdc7
2 changed files with 34 additions and 3 deletions

View File

@ -0,0 +1,23 @@
<?php
$conn = new mysqli("localhost", "lukejelse04", "C3ssNa182", "snexo");
if($conn->connect_errno){
echo "<h6>Error: $conn->connect_error </h6>";
}else{
$currentAddress = $_SERVER['REMOTE_ADDR'];
$dateTime = date('d/m/Y H:i:s');
echo "<h6> $dateTime </h6>";
$sqlquery = "INSERT INTO VisitTime (IPAddress, DateTime) VALUES ('$currentAddress', '$dateTime')";
$result = $conn -> query($sqlquery);
}
?>