68 lines
1.8 KiB
PHP
68 lines
1.8 KiB
PHP
<?php
|
|
session_reset();
|
|
session_start();
|
|
ini_set('display_errors', 1);
|
|
ini_set('display_startup_errors', 1);
|
|
error_reporting(E_ALL);
|
|
$root = realpath($_SERVER["DOCUMENT_ROOT"]);
|
|
require "$root/database/credentials.php";
|
|
// Connect the database
|
|
try {
|
|
$db = new PDO("mysql:host=$host;dbname=$database;charset=utf8",
|
|
$user,
|
|
$password,
|
|
array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
|
|
));
|
|
} catch (Exception $e) {
|
|
die("Error : ".$e->getMessage());
|
|
}
|
|
|
|
$req = $db->prepare('SELECT * FROM `authors`');
|
|
$req->execute();
|
|
$result = $req->fetchAll();
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Explore | Chiro - Canto</title>
|
|
<link rel="stylesheet" type="text/css" href="/styles/style.css">
|
|
</head>
|
|
<?php
|
|
include("$root/analytics/matomo.php");
|
|
?>
|
|
<body>
|
|
<?php include("$root/menu.php");?>
|
|
<?php include("$root/header.php");?>
|
|
<section>
|
|
<h3>Explore</h3>
|
|
<h4>Random Record</h4>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Username</th>
|
|
<th>Private message link</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php
|
|
foreach($result as $row) {
|
|
?>
|
|
<tr>
|
|
<th><?=$row['firstname']?> <?=$row['lastname']?></th>
|
|
<th><?=$row['username']?></th>
|
|
<th><a href="/discussion/messages/?author=<?=$row['id']?>"><img src="/media/icons/bubble.png" alt="message bubble"></a></th>
|
|
</tr>
|
|
<?php
|
|
}
|
|
?>
|
|
</tbody>
|
|
</table>
|
|
</section>
|
|
<?php include("$root/footer.php");?>
|
|
</body>
|
|
<script src="/scripts/script.js"></script>
|
|
</html>
|