Hi, I am getting lots of contact form submissions with characters like ×¢²áÃã¸Û¹«Ë¾ in the form fields... What would be the best way to block these, and basically not send the email out if the posted fields contain these type of characters. Thanks
Try something like: function validate_fields($s) { $forbidden = array('\r', '\n', 'mime', 'MIME', 'charset', 'bcc', 'Bcc'); foreach ($forbidden as $f) if (strpos($s, $f) !== false) return false; return true; } if (!validate_fields($_POST['from'])) { echo "what ever"; } Code (markup): Ian