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

66 lines
1.9 KiB
PHP
Raw Normal View History

2020-03-02 08:52:22 +01:00
<?php
session_start();
%SET_LOGIN_VARIABLE%
2020-03-02 08:52:22 +01:00
%NO_CHEAP_SESSION_STEALING%
%PLEAZE_NO_CACHE%
2020-03-08 16:07:27 +01:00
%REQUIRE_LOGIN%
2020-03-02 08:52:22 +01:00
$navbar="boards";
2020-03-06 10:27:57 +01:00
$id=$_GET['id'];
2020-03-02 08:52:22 +01:00
?>
<!DOCTYPE html>
<html>
<head>
<title>ThreadR - Boards</title>
2020-03-05 04:56:06 +01:00
%STYLESHEET%
2020-03-02 08:52:22 +01:00
<link rel="icon" type="image/png" href="%CONTENT_DIR%/img/favicon-32x32.png" sizes="32x32" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
%NAVBAR%
<div class="container">
<div class="item-1">
<h1><center>
<?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 WHERE id=:id");
2020-03-06 10:27:57 +01:00
$statement->execute(array("id"=>$id));
$result = $statement->fetch();
2020-03-04 10:45:05 +01:00
echo $result['name'];
}
if (!$result) {
$error_message = "Error: SQL error.\n" . $statement->queryString . "\n" . $statement->errorInfo()[2];
}
?>
</center></h1>
2020-03-02 08:52:22 +01:00
</div>
<div class="item-2">
2020-03-08 03:32:28 +01:00
<?php
2020-03-08 03:35:46 +01:00
include("./board.php");
2020-03-08 03:32:28 +01:00
?>
</div>
2020-03-08 03:41:05 +01:00
<div class="item-3">
<?php
if(isset($_GET['action'])) {
if($_GET['action']=='post') {
include("./post.php");
2020-03-08 16:40:43 +01:00
} elseif($_GET['action']=='submit') {
2020-03-08 17:24:06 +01:00
$user_id=$_SESSION[user_id];
echo "$user_id";
2020-03-08 17:18:18 +01:00
$title=$_POST['title'];
$content=$_POST['content'];
2020-03-08 16:40:43 +01:00
include("./submit.php");
2020-03-08 03:41:05 +01:00
} elseif($_GET['action']=='edit') {
include("./edit.php");
}
} else {
include("./default.php");
}
?>
</div>
2020-03-02 08:52:22 +01:00
</div>
</body>
</html>