Added the Analytics Page to the webpage
This commit is contained in:
parent
d15b16bc63
commit
c9804abdc7
23
assets/analytics/analytics.php
Normal file
23
assets/analytics/analytics.php
Normal 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);
|
||||
|
||||
}
|
||||
|
||||
|
||||
?>
|
14
index.php
14
index.php
@ -20,7 +20,7 @@
|
||||
<body id="page-top">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -48,7 +48,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -69,6 +69,9 @@
|
||||
</div>
|
||||
<!-- Masthead Subheading-->
|
||||
<p class="masthead-subheading font-weight-light mb-0">We Buy Your Unwanted Items</p>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</header>
|
||||
|
||||
@ -319,7 +322,12 @@
|
||||
</footer>
|
||||
<!-- Copyright Section-->
|
||||
<div class="copyright py-4 text-center text-white">
|
||||
<div class="container"><small>Copyright © Snexo <?php echo date("Y"); ?></small></div>
|
||||
<div class="container"><small>Copyright © Snexo <?php echo date("Y"); ?><?php
|
||||
|
||||
include_once "assets/analytics/analytics.php";
|
||||
|
||||
?></small></div>
|
||||
|
||||
</div>
|
||||
<!-- Scroll to Top Button (Only visible on small and extra-small screen sizes)-->
|
||||
<div class="scroll-to-top d-lg-none position-fixed">
|
||||
|
Loading…
x
Reference in New Issue
Block a user