Mercurial > hg > Blog
diff submit_comment.php @ 112:cf31bf5fce72 default tip
Author of the blog post as mail header for efficient spam filtering
author | Dirk Olmes <dirk.olmes@codedo.de> |
---|---|
date | Tue, 06 Sep 2022 07:04:11 +0200 |
parents | a30aee3f6158 |
children |
line wrap: on
line diff
--- a/submit_comment.php Mon Apr 04 15:36:16 2022 +0200 +++ b/submit_comment.php Tue Sep 06 07:04:11 2022 +0200 @@ -17,13 +17,14 @@ $author = htmlspecialchars($_POST['Author']); $comment = htmlspecialchars($_POST['Comment']); $date = date('Y-m-d H:i:s'); + $header = 'X-Comment-Author: ' . $author; $message = 'Author: ' . $author . PHP_EOL . 'Date: ' . $date . PHP_EOL . PHP_EOL . $comment; $subject = 'New blog post comment on article ' . $slug; - mail($recipient, $subject, $message); + mail($recipient, $subject, $message, $header); ?>