I can't connect the comment form to the database [closed]

Closed. This question needs debugging details. It is not currently accepting answers. Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question. Closed 7 hours ago. Improve this question <form class='form-comment' method='POST' action="<?php echo esc_url($_SERVER['REQUEST_URI']); ?>"> <textarea class="input-param input-param1" placeholder="Полное имя" name="name" required ></textarea> <textarea type="email" class="input-param input-param2" placeholder='Email' name="email" required></textarea> <textarea class="input-content" name="comment" placeholder="Поделись своими мыслями..." required ></textarea> <input type="hidden" name="post_id" value="<?php echo get_the_ID(); ?>"> <input type="submit" class="button-submit" value="Отправить комментарий" /> </form> <?php if ($_SERVER['REQUEST_METHOD'] === 'POST') { var_dump($_POST); echo 'Форма отправлена!'; $author = sanitize_textarea_field($_POST['name']); $email = sanitize_email($_POST['email']); $text = sanitize_textarea_field($_POST['comment']); $post_id = intval($_POST['post_id']); if (!empty($author) && !empty($email) && !empty($text) && !empty($post_id)) { $commentdata = array( 'comment_post_ID' => $post_id, 'comment_author' => $author, 'comment_author_email' => $email, 'comment_content' => $text, 'comment_approved' => 1, ); $result = wp_new_comment($commentdata); if ($result) { echo 'Комментарий успешно добавлен!'; } else { echo 'Ошибка при добавлении комментария.'; } } else { echo 'Пожалуйста, заполните все поля.'; } } ?> In the config.php file I created a comment form so that you can leave comments under a post in WordPress. But when we click on the submit we get a 404 error. Why?

Comment (0)

You’ll be in good company