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

49 lines
1.5 KiB
PHP

<!DOCTYPE html>
<html>
<head>
<title>ThreadR - Boards</title>
<link rel="stylesheet" type="text/css" href="%CONTENT_DIR%/style.css">
</head>
<body>
<ul class="topnav">
<li><a href="%CONTENT_DIR%/">Home</a></li>
<li><a href="%CONTENT_DIR%/news/">News</a></li>
<li><a class="active" href="%CONTENT_DIR%/boards/">Boards</a></li>
<li><a href="%CONTENT_DIR%/about/">About</a></li>
<li class="right"><a href="%CONTENT_DIR%/login/">Log In</a></li>
</ul>
<div style="padding:0 16px;">
<p></p>
<p></p>
<h4></h4>
</div>
<div class="container">
<div class="item-1">
<h1><center>ThreadR Boards</center></h1>
</div>
<div class="item-2">
<ul class="topnav">
<?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>";
}
}
if (!$result) {
$error_message = "Error: SQL error.\n" . $statement->queryString . "\n" . $statement->errorInfo()[2];
}
?>
</ul>
</div>
</div>
</body>
</html>