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

28 lines
880 B
PHP

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