How can one ensure that bots do not accidentally delete database entries when following links in PHP applications?

To prevent bots from accidentally deleting database entries when following links in PHP applications, one can implement a confirmation step before executing any deletion queries. This can be done by adding a confirmation dialog box using JavaScript or a separate confirmation page where the user must confirm the deletion action.

<?php
if(isset($_GET['delete_id'])) {
    $id = $_GET['delete_id'];
    // Display confirmation dialog
    echo "<script>
            var result = confirm('Are you sure you want to delete this entry?');
            if(result) {
                // Proceed with deletion query
                // $sql = "DELETE FROM table WHERE id = $id";
                // Execute deletion query
            } else {
                // Redirect back to the previous page or display a message
            }
          </script>";
}
?>