|
Posted by rcoan@chaparralboats.com on 03/01/07 15:37
Thanks for the explanation J.O. that definately made things clearer.
So would something like this work?
// checking for injection and clearing any present injections
$emailInput = array($to, $from, $cc, $bcc, $subject, $message);
$injections = array('to', 'from', 'cc', 'bcc');
foreach ($emailInput as $input)
{
foreach ($injections as $injection)
{
$input = preg_replace("/n?" . $injection . "\s*?:.*?\n/i", '',
$input);
}
// send email
$success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");
Navigation:
[Reply to this message]
|