How can PHP forms be configured to automatically assign comments to specific news articles based on their IDs?

To automatically assign comments to specific news articles based on their IDs, you can include a hidden input field in the form that captures the article ID. This hidden field can be pre-filled with the ID of the news article the comment is being submitted on. In the PHP script that processes the form submission, you can then retrieve this article ID from the hidden input field and use it to store the comment in the database associated with the correct news article.

<form action="process_comment.php" method="post">
    <input type="hidden" name="article_id" value="<?php echo $article_id; ?>">
    <textarea name="comment"></textarea>
    <input type="submit" value="Submit Comment">
</form>
```

In process_comment.php:
```php
$article_id = $_POST['article_id'];
$comment = $_POST['comment'];

// Save the comment in the database with the corresponding article ID
// INSERT INTO comments (article_id, comment) VALUES ($article_id, $comment)