There is a handler for adding a comment:
if (isset($_POST['CommentEnter'])) { $text = $_POST['text']; $mark = $_POST['mark']; $idproduct = $params[1]; $text = stripslashes($text); $text = htmlspecialchars($text); $text = trim($text); $add = new Model_Product(); $add->add_comment($idproduct,$text, $mark); } So after adding a comment, I would like to forcibly reload the page so that the added comment becomes visible, how to do it?
header('Location: http://www.example.com/'); exit;header('Location: http://www.example.com/'); exit;... php.net/manual/ru/… ... if everything was already thereecho "<script>window.location = 'http://www.example.com/'; </script>";...... but in general in the modern world everything is done throughajaxwithout rebooting .... that is, you need to send a request to the server via Ajax, it will return the value, and on the client the script will add an entry to the DOM - Alexey Shimansky