threadr.lostcave.ddnss.de/threadr/boards/index.php

31 lines
947 B
PHP
Raw Normal View History

2020-02-19 22:16:27 +01:00
<!DOCTYPE html>
<html>
2020-02-19 22:26:06 +01:00
<head>
<title>ThreadR Boards</title>
<link rel="stylesheet" type="text/css" href="%CONTENT_DIR%/style.css">
</head>
2020-02-19 22:16:27 +01:00
<body>
2020-02-19 22:20:25 +01:00
<?php
2020-02-19 22:23:41 +01:00
$pdo = new PDO('mysql:host=localhost;dbname=web', 'webstuff', 'Schei// auf Pa$$w0rter!');
$error = false;
$error_message = "";
2020-02-19 22:26:06 +01:00
2020-02-19 22:23:41 +01:00
if (!$error) {
2020-02-19 22:26:06 +01:00
$statement = $pdo->prepare("SELECT * FROM boards");
2020-02-19 22:20:25 +01:00
$statement->execute();
2020-02-19 22:16:27 +01:00
2020-02-19 22:20:25 +01:00
echo "<ul class="topnav">"
foreach($statement->fetchAll() as $ROW) {
2020-02-19 22:26:06 +01:00
echo "<li><a href='%CONTENT_DIR%/boards?=$ROW[id]'>$ROW[name]</a></li>";
2020-02-19 22:20:25 +01:00
}
echo "</ul>"
2020-02-19 22:26:06 +01:00
2020-02-19 22:20:25 +01:00
}
2020-02-19 22:23:41 +01:00
if (!$result) {
2020-02-19 22:20:25 +01:00
$error_message = "Error: SQL error.\n" . $statement->queryString . "\n" . $statement->errorInfo()[2];
}
?>
2020-02-19 22:16:27 +01:00
</body>
</html>