Re: simple scrip to stop email injection
| From: | Ivo F.A.C. Fokkema | Date: | Wed, 16 Aug 2006 11:05:22 +0000 |
| Subject: | Re: simple scrip to stop email injection | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-240764@lists.php.net to get a copy of this message | ||
On Wed, 16 Aug 2006 10:53:30 +0100, Ross wrote:
>
> Been having loads of problems with this and have solved it using the
> phpmailer. The only problem is I cannot get the class working on the remote
> host I am working on. I am back to using mail() but need to drop in script
> that checks my fields $fname, $sname, $email, $subject, $message.
Couldn't you do a preg_match on \n, \r or \r\n for the $fname, $sname,
$email and $subject? Checking $message would not be necessary, as it would
probably contain linebreaks and it's not included in the message header
anyway...
HTH!
Ivo