From c9804abdc754f5864a381e32beaf09be4216f3ac Mon Sep 17 00:00:00 2001 From: lukejelse04 Date: Mon, 22 Mar 2021 08:44:26 +0000 Subject: [PATCH] Added the Analytics Page to the webpage --- assets/analytics/analytics.php | 23 +++++++++++++++++++++++ index.php | 14 +++++++++++--- 2 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 assets/analytics/analytics.php diff --git a/assets/analytics/analytics.php b/assets/analytics/analytics.php new file mode 100644 index 0000000..9fd3e3e --- /dev/null +++ b/assets/analytics/analytics.php @@ -0,0 +1,23 @@ +connect_errno){ + + echo "
Error: $conn->connect_error
"; + + }else{ + + $currentAddress = $_SERVER['REMOTE_ADDR']; + $dateTime = date('d/m/Y H:i:s'); + + echo "
$dateTime
"; + + $sqlquery = "INSERT INTO VisitTime (IPAddress, DateTime) VALUES ('$currentAddress', '$dateTime')"; + + $result = $conn -> query($sqlquery); + + } + + +?> \ No newline at end of file diff --git a/index.php b/index.php index bf0c33c..b7e7aee 100644 --- a/index.php +++ b/index.php @@ -20,7 +20,7 @@ - + @@ -48,7 +48,7 @@ - + @@ -69,6 +69,9 @@

We Buy Your Unwanted Items

+ + + @@ -319,7 +322,12 @@