valid data clean post clean get php

How to valid data clean post clean get php

 

filter_var($user_input, FILTER_SANITIZE_STRIPPED);

The filter_var function is used to validate and sanitize data.

Validation checks if the data is of the right type. A numeric validation check on a string returns a false result.

Sanitization is removing illegal characters from a string.

It uses the filter_var function and FILTER_SANITIZE_STRIPPED constant to strip tags.

 

mysqli_real_escape_string();

 

mysqli_real_escape_string function This function is used to protect an application against SQL injection.

Let’s suppose that we have the following SQL statement for validating the user id and password.

 

strip_tags();

This tag was remove HTML, Java Scrip, PHP tags

This function is useful when we have to protect our application against attacks such as cross site scripting.

Giới thiệu honest 237 bài viết
Mình lập blog này với mục đích lưu lại + chia sẻ các các kiến thức mình đã biết hoặc đang tìm hiểu. Cơ bản giúp ích cho mình :) Nhưng hy vọng sẽ mang lại sự khởi đầu thuận lợi cho người mới bắt đầu!