Made a small contact form on php, it gets $_POST
variables and mails to me.
<form action="/myscript.php" method="post">
Small piece of code:
$subject = trim($_POST['subject']);
$comment = trim($_POST['comment']);
mail($email, $subject, $comment, $headers);
$email
is mine mail address, $headers
are usual.
There is no filtration for subject and comment. Can it be a potential security hole to my site?
My mail is placed on gmail.com. Can unfiltered mail from my site hurt me, when I open gmail interface in browser?
How should I filter all the variables? Maybe I wish echo
some of them on my site, after sending an email. (like 'Thanks, %name% !')