In this article I am going to talk about PHP Secure Input Data and secure your website more. When a user input something via URL then this function clean this and make more secure to use on the website.
Why Secure Input Data?
For preventing SQL injection you should use this function into your website's script. Most of the hackers are using SQL Injection method to bypass a security system. So, It's one of the major parts to make your website safe. This function prevents SQL Injection and saves your website from hackers.
How to Secure Input Data?
Yes, now we are on the way to make our website safer. Create a PHP Function name as CleanQuery(); and put down this code in this function.
We have created the function for clean input data. We used some words which are uses in bypass website security. When a user tries to pass these values using input $_GET or $_POST then this function automatically remove them and pass a safe value in script.
How To Use CleanQuery(); ?
After creating this function put it into you function file that means which is using for all functions. Include this file into all of the files. Now it's ready for use. When you pass an input into your script then clean this input using this function. example-
Now users inputs save. You can change your badWords like your targeted words. So, don't late to make your website safe, just use this function to get safe data from a user. If you have any question or comment about this PHP Secure Input Data article please don't hesitate to do that, please comment your question in comment section.