1024) { return 'Post is too long or short.'; } $stmt = $db->prepare("INSERT INTO main.comment (username, targetType, targetId, date, content, id) VALUES (?,?,?,?,?,?)"); $stmt->execute([$username,"root","root",microtime(true) - $ref,$postie,bin2hex(random_bytes(16))]); header("Location: " . $_SERVER["REQUEST_URI"]); die(); } page_header(); $form_message = post_handler(); $page = array_key_exists('page',$_GET) ? ($_GET['page']) : 0; ?>
'Your message', 'type' => 'textarea', 'name' => 'post', 'default' => '') )); } ?> prepare("SELECT * FROM comment ORDER BY date DESC LIMIT ? OFFSET ?"); $stmt->execute([ 10, $page * 10 ]); $posts = $stmt->fetchAll(PDO::FETCH_DEFAULT); foreach ($posts as $post) { ?>