PHP's Filter Module
-
Upload
chris-tankersley -
Category
Lifestyle
-
view
3.158 -
download
0
description
Transcript of PHP's Filter Module
![Page 1: PHP's Filter Module](https://reader036.fdocuments.in/reader036/viewer/2022070317/5564af53d8b42a3e618b4772/html5/thumbnails/1.jpg)
PHP’s Filter Extension
August 16, 2011 NWO-PUG 1
E-mail: [email protected]: @dragonmantankIdenti.ca: dragonmantank
![Page 2: PHP's Filter Module](https://reader036.fdocuments.in/reader036/viewer/2022070317/5564af53d8b42a3e618b4772/html5/thumbnails/2.jpg)
Who Are You and Why Are You In My House?
Chris Tankersley Doing PHP for 8 Years Lots of projects no one uses, and a
few that some do TL;DR
https://github.com/dragonmantank
April 26, 2011 NWO-PUG 2
![Page 3: PHP's Filter Module](https://reader036.fdocuments.in/reader036/viewer/2022070317/5564af53d8b42a3e618b4772/html5/thumbnails/3.jpg)
Some Background
Enabled by default since 5.2.0 Provides both Validation and
Sanitization Very easy to use to work with data Exposed via the filter_var() function
April 26, 2011 NWO-PUG 3
![Page 4: PHP's Filter Module](https://reader036.fdocuments.in/reader036/viewer/2022070317/5564af53d8b42a3e618b4772/html5/thumbnails/4.jpg)
Validation
Makes sure that data meets specifications An e-mail address looks like an e-mail address
Allows basic validation Boolean E-mail Float Int IP Regex URL
April 26, 2011 NWO-PUG 4
![Page 5: PHP's Filter Module](https://reader036.fdocuments.in/reader036/viewer/2022070317/5564af53d8b42a3e618b4772/html5/thumbnails/5.jpg)
Validating Data
April 26, 2011 NWO-PUG 5
![Page 6: PHP's Filter Module](https://reader036.fdocuments.in/reader036/viewer/2022070317/5564af53d8b42a3e618b4772/html5/thumbnails/6.jpg)
What Filters are Available?
April 26, 2011 NWO-PUG 6
![Page 7: PHP's Filter Module](https://reader036.fdocuments.in/reader036/viewer/2022070317/5564af53d8b42a3e618b4772/html5/thumbnails/7.jpg)
Sanitization
Removes data that does not meet specifications
Many more options with this
April 26, 2011 NWO-PUG 7
![Page 8: PHP's Filter Module](https://reader036.fdocuments.in/reader036/viewer/2022070317/5564af53d8b42a3e618b4772/html5/thumbnails/8.jpg)
Sanitizing Data
April 26, 2011 NWO-PUG 8
![Page 9: PHP's Filter Module](https://reader036.fdocuments.in/reader036/viewer/2022070317/5564af53d8b42a3e618b4772/html5/thumbnails/9.jpg)
What Sanitizers are Available?
April 26, 2011 NWO-PUG 9
![Page 10: PHP's Filter Module](https://reader036.fdocuments.in/reader036/viewer/2022070317/5564af53d8b42a3e618b4772/html5/thumbnails/10.jpg)
What Sanitizers are Available?
April 26, 2011 NWO-PUG 10
![Page 11: PHP's Filter Module](https://reader036.fdocuments.in/reader036/viewer/2022070317/5564af53d8b42a3e618b4772/html5/thumbnails/11.jpg)
Manual Filters
April 26, 2011 NWO-PUG 11
![Page 12: PHP's Filter Module](https://reader036.fdocuments.in/reader036/viewer/2022070317/5564af53d8b42a3e618b4772/html5/thumbnails/12.jpg)
filter_has_var
Used as further validation for data input
April 26, 2011 NWO-PUG 12
![Page 13: PHP's Filter Module](https://reader036.fdocuments.in/reader036/viewer/2022070317/5564af53d8b42a3e618b4772/html5/thumbnails/13.jpg)
April 26, 2011 NWO-PUG 13
![Page 14: PHP's Filter Module](https://reader036.fdocuments.in/reader036/viewer/2022070317/5564af53d8b42a3e618b4772/html5/thumbnails/14.jpg)
Questions?
April 26, 2011 NWO-PUG 14
![Page 15: PHP's Filter Module](https://reader036.fdocuments.in/reader036/viewer/2022070317/5564af53d8b42a3e618b4772/html5/thumbnails/15.jpg)
LinksWhere to Find Stuff I Talked About
April 26, 2011 NWO-PUG 15
![Page 16: PHP's Filter Module](https://reader036.fdocuments.in/reader036/viewer/2022070317/5564af53d8b42a3e618b4772/html5/thumbnails/16.jpg)
Links
Filter Documentation http://www.php.net/manual/en/
book.filter.php
April 26, 2011 NWO-PUG 16