video #38D - Advance PHP | SQL (Insert, Update, Delete)

5 months ago
3

This is the 4th video #38D. We will filters out the Input Post Data. The use of the sanitize filters.

The “FILTER_SANITIZE_STRING” filter strips tags and HTML-encode double and single quotes, optionally strip or encode special characters.

Encoding quotes can be disabled by setting.

The “FILTER_SANITIZE_INT” filter removes all characters except digits, plus and minus sign.

The “FILTER_SANITIZE_EMAIL” filter removes all characters except letters, digits and !#$%&'*+-=?^_`{|}~@.[].

Filter Flags:

FILTER_FLAG_NO_ENCODE_QUOTES - Do not encode quotes
FILTER_FLAG_STRIP_LOW - Remove characters with ASCII value < 32
FILTER_FLAG_STRIP_HIGH - Remove characters with ASCII value > 127
FILTER_FLAG_ENCODE_LOW - Encode characters with ASCII value < 32
FILTER_FLAG_ENCODE_HIGH - Encode characters with ASCII value > 127
FILTER_FLAG_ENCODE_AMP - Encode the "&" character to &amp;

Now, The “filter_input()” function gets an external variable from form input and optionally filters it.

This function is used to validate variables from insecure sources, such as user input.

Loading comments...