V2:Installation

From PhpInputValidator

Jump to: navigation, search

Contents

Step 1:

Download the most current version of phpInputValidator

Step 2:

Upload the files to your webserver.

Only what is contained in the lib directory is required to run, so you could create a folder on your weserver called phpInputValidator and upload everything from the lib directory into that directory

Step 3:

Link to the file inputValidator.php.

A absolute path is best.  An example:

require dirname(__FILE__).'/phpInputValidator/lib/inputValidator.php';

Step 4:

Configure your instance.  See Configuration

Step 5:

Use it!

My suggestion would be to assing the class to a global variable and use it that way.

Optional:

It is highly recommend that download and install HTMLPurifier from http://htmlpurifier.org/ if you will taking in HTML input. This library allows you to strip unsafe HTML as well as cleanup bad HTML. Its a very good library and a highly recommend addition to phpInputValidator. Using this library is the only way phpInputValidator will take in HTML.