The kindest evening. Can you tell me how to implement the approval and delete buttons from the site? I only thought of this:
<form method="POST"> <input type="hidden" name = "new_cat" value="<?php echo $row['id'] ?>"> <input type="submit" name="submit" value="Отправить"> </form> <?php $data = $_POST; if (isset($data['submit'])) { $sql = ("UPDATE `films` SET `fpublic` = '1' WHERE `id`=".$data['new_cat']); $result = $pdo->prepare($sql); $result ->execute(); } ?> To cling on two forms to each post is somehow not logical. Yes, and the page does not work correctly: Click on the button, the page reloads, everything remains unchanged, reload the page itself, a window appears confirming the resubmission of data, and then the post is published.
So what is the easiest way to implement these two buttons for posting and deleting a post?