There was such a question: how to make the user stay on the place where he was when writing, for example, a comment when reloading the page? those. when writing a comment, and sending it, I constantly reload the page, and I find myself at the very top of the site, but I need to stay where I wrote the comment.
session_start(); include_once("settings.php"); $sql = sprintf("SELECT comment_text FROM comments WHERE id_post = '$post' ORDER BY id_comment"); $result = mysqli_query($connection, $sql); while($row = mysqli_fetch_assoc($result)){ echo '<div class = "row comment pt-2"><div class = "col-md-1"><img class = "avatar" src = "../assets/images/user.png"></div><div class = "comment col-md-11">'. $row['comment_text'].'</div></div>'; }