Fork me on GitHub

About

What is it?

phpInputValidator is an Open Source input validation and filtering library written in PHP.

What can it do?

Here is a none exhausted list of what it can do:

  • Fetch data from
    • POST
    • GET
    • REQUEST
    • COOKIE
    • SESSION
    • SERVER
  • Validate fetched data using
    • Common PHP type checking function
    • Custom type checking function
    • Your custom made type checking function
  • Filter data according to
    • Size
    • Length
    • Valid possible values
    • Invalid values
    • Regex
  • Watch for and respond to security attacks
  • Typecast data to be returned (if valid)
  • Strip HTML
  • Purify HTML
  • Add slashes
  • Strip slashes
  • Clean up string data

How does it work?

Please see the examples.
Or the demo.

Why do I need it?

It will allow you to safely fetch and validate any input to your program/page. It will save you lots of time.
It will also improve security on your site greatly.

Also how about instead of all this code:

if (isset($_POST['uid'])) {
     $uid = (int)$_POST['uid'];
     if ($uid <= 2) {
     	$uid = null;
     }
} else {
    $uid = null;
}

You could do:
$uid = $getvar->get(‘uid’, ‘POST’, ‘int’, array(‘min_between’ => 3));

I need more help?

Please see the forums.

I found a bug

Please either post on the forums or see the tickets.

I found an exploit

Please either send me a private message on the forums or you can email me technocrat @ this site’s url.

I would like to suggest a new filter or other change

Please post your request here

I like being on the cutting edge, can I see the SVN?

Yes. See assembla

Can I help on the project?

If you know PHP programming, sure. Simply contact me on the forums or you can email me technocrat @ this site’s url

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Download

Version: 2.0.1

ziptar

Downloads: 800