While working on developing a forum, I encountered an issue where if I repeatedly input letters or words without any spaces, it causes everything to overlap. Below is an example highlighting this problem:
https://i.sstatic.net/KStNq.png
Although there is a character limit for both the title and body sections, the body has a limit of around 200 characters which I am hesitant to reduce.
<html lang="nl">
<head>
<title>WilliamOverman</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="assets/css/style.css">
<link href='https://fonts.googleapis.com/css?family=Quicksand' rel='stylesheet'>
<link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="5e3c31312a2d2a2c3f2e1e6b706e706c">[email protected]</a>/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="2a4845455e595e584b5a6a1f041a0418">[email protected]</a>/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
</head>
<body>
<?php
include 'assets/header.php';
require_once('assets/getInfo.php');
?>
<div class="container">
<div class="row">
<div class="container col-md-6" style="margin-top: 1rem">
<?php
foreach (getPost()['posts'] as $item) {
echo " <div class='list-group' style='font-family: Quicksand; margin-top: .5rem'>
<a href='post?msgid=" . $item['id'] . "' class='list-group-item list-group-item-action' aria-current='true'>
<div class='d-flex w-100 justify-content-between'>
<h5 class='mb-1'> " . $item['titel'] . " </h5>
<small>" . $item['bericht_create_date'] . "</small>
</div>
<p class='mb-1'>" . $item['bericht'] . "</p>
<small>Posted by " . $item['username'] . "</small>
</a>
</div>";
}
echo "
<div class='container col-md-8 text-center justify-content-center' style='margin-top: .5rem;'>
<a class='btn btn-primary' role='button' href='forum?page=1'><<</a>
<a class='btn btn-primary' role='button' href='" . prevpage() . "'><</a>
<a class='btn btn-primary' role='button' href='" . nextpage() . "'>></a>
<a class='btn btn-primary' role='button' href='" . lastpage() . "'>>></a>
</div>
";
?>
</div>
<?php
if (isset($_SESSION['loggedin']) && $_SESSION['loggedin'] == true) {
echo
"<div class='container col-md-3' style='margin-top: 1rem'>
<form method='post' action='assets/postAddHandler'>
<div class='form-group'>
<label for='formGroupExampleInput'>Titel</label>
<input type='text' name='titel' class='form-control' id='formGroupExampleInput' placeholder='Example input'>
</div>
<div class='form-group'>
<label for='exampleFormControlTextarea1'>Bericht</label>
<textarea class='form-control' name='bericht' id='exampleFormControlTextarea1' rows='3'></textarea>
</div>
<div class='form-group'>
<label for='exampleFormControlFile1'>Foto</label>
<input type='file' name='foto' class='form-control-file' id='exampleFormControlFile1'>
</div>
<div class='form-group' style='margin-top: .5rem'>
<button type='submit' name='addPost' class='btn btn-success'>Add post</button>
</div>
</form>
</div>
";
}
?>
</div>
</div>
</body>
</html>