-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsecuritylog.php
More file actions
35 lines (32 loc) · 960 Bytes
/
Copy pathsecuritylog.php
File metadata and controls
35 lines (32 loc) · 960 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
$dbhost="localhost";
$user="root";
$pass="root";
$db="version";
$conn=mysqli_connect($dbhost,$user,$pass,$db);
$username = $_SESSION['username'];
$sql="SELECT username, ipadd, logintime,logindate, timelogin, message from security where username='$username' ORDER BY logintime DESC ";
$result=mysqli_query($conn,$sql);
if(!$result)
{
echo "</br>"."Error: Nothing to show";
}
else
echo "</br>";
$page = $_SERVER['PHP_SELF'];
$sec = "600";
header("Refresh: $sec; url=$page");
while($row=mysqli_fetch_array($result))
{
echo "<div class=\"uk-card uk-card-default uk-card-body\">";
echo "<div align=\"center\">";
echo "<h3>"."Your account was accessed on "."{$row['logindate']}"." at "."{$row['timelogin']}"."</h3>";
echo "IP Address- "."{$row['ipadd']}"."</br>";
echo "Timestamp- "."{$row['logintime']}"."</br>"."</br>";
echo "Status: "."{$row['message']}"."</br>";
echo "</div>";
echo "</div>";
echo "</br>";
}
mysqli_close($conn);
?>