-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathviewall.php
More file actions
35 lines (28 loc) · 942 Bytes
/
Copy pathviewall.php
File metadata and controls
35 lines (28 loc) · 942 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
session_start();
if($_SESSION['user']['type'] != 1)
{
echo "<script>alert('Please sign in as an Admin!!')
window.location.href='signin.php';
</script>";
}
include("dbcon.php");
$query = "SELECT fname, lname, username, toac, lastlogin FROM registeredusers";
$result=mysqli_query($connection,$query);
if (!$result) die($connection->error);
elseif (mysqli_num_rows($result))
{
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
echo "First name: " . $row['fname']. ", last: " . $row['lname']. ", username: " . $row['username']. ", Created: " . $row['toac']. ", last login: " . $row['lastlogin']. "<br>";
}
} else {
echo "0 results";
}
$result->close();
}
else die("noconnect");
$connection->close();
echo ("<button onclick= location.href='admin.php'>go back</button>");
?>