PHP SQL Sanitize is a kind of filter which is used to allow or disallow characters in a string.
This example illustrates how to implement the sanitized filter in php application.
Filter knows two kinds of filter:
The sanitizing filters:
Understand with Example
The Tutorial illustrate an example from 'PHP SQL Sanitize'. To understand the example we create a sanitize.php embeds a html page, which allows the user to enter the name in the text field. When accepting data from a user, any data at all should be sanitized before making its way. To sanitize the data we make use of php code begins with <?php and end with ?>. For name field, there is no type to validate against, it can be filtered to remove HTML tags. The conditional if ($ name) evaluate to true if the $_POST['name'] variable was set and passed the filter. This will print the filtered version and the original version..
Source Code of sanitize.php
Posted on: February 4, 2009 If you enjoyed this post then why not add us on Google+? Add us to your Circles