security - How to sanitze user input in PHP before mailing? -


I have a simple PHP mailer script that takes the form submitted through POST and mails them Is:

  & lt ;? Php $ to = "me@example.com"; $ Name = $ _POST ['name']; $ Message = $ _POST ['message']; $ Email = $ _POST ['email']; $ Body = "person $ name submits a message: $ message"; $ Theme = "a message is presented"; $ Header = 'to:' $ email; Mail ($ $ to $ $ theme, $ body, $ headers); Header ("Location: http://example.com/thanks"); ? & Gt;  

How can I input the input?

Like:

  resonant filter_ ($ _ POST ['email'], FILTER_SANITIZE_EMAIL);  

Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -