My PHP scripts recieves information (from a user submitted form) and sends it (almost) straight away as an email. What kind of sainitization should I do on the data?
I want to know exactly which PHP function to use to sanitize the data.
My PHP scripts recieves information (from a user submitted form) and sends it (almost) straight away as an email. What kind of sainitization should I do on the data?
I want to know exactly which PHP function to use to sanitize the data.
You need to read up on email injection. Take a look here:
Have a look at PHP Data Filtering. There are a lots of built in php functions which can be used for data validation and sanitization.
$message (which contains the users message) to make sure that there is no email injections. (Perhaps it's a matter of just showing me exactly which method of filter_var() to use?)You'll want to: