PHP Classes

Input Filter: strip unwanted tags , words in post method

Recommend this page to a friend!
  All requests RSS feed  >  Input Filter  >  Request new recommendation  >  A request is featured when there is no good recommended package on the site when it is posted. Featured requests  >  No recommendations No recommendations  

Input Filter

Edit

Picture of santhosh by santhosh - 10 years ago (2015-06-02)

strip unwanted tags , words in post method

This request is clear and relevant.
This request is not clear or is not relevant.

+3

prevent xss attacks in php code. remove html tags , bad words while posting values using form

Ask clarification

1 Recommendation

PHP Input Filter: Filter out unwanted PHP / Javascript / HTML tags.

This class can filter input of stray or malicious PHP, Javascript or HTML tags and to prevent cross-site scripting (XSS) attacks. It should be used to filter input supplied by the user, such as an HTML code entered in form fields.

I have tried to make this class as easy as possible to use. You have control over the filter process unlike other alternatives, and can input a string or an entire array to be cleaned (such as $_POST).

** SQL Injection feature has been added.
This recommendation solves the problem.
This recommendation does not solve the problem.

+1

Picture of Dave Smith by Dave Smith Reputation 7625 - 10 years ago (2015-06-02) Comment

This is the class that I have always used, very easy to configure for what tags and properties to allow and it strips the rest. It does most of the heavy lifting you are looking for including xss filter, except it does not have a bad word filter. I was not able to locate any that combined stripping tags, xss prevention and bad word filter, so you would have to use an additional bad word filter class, there are plenty on here to choose from.


Recommend package
: 
: