PHP is safe. I want to ask, what should I do if I receive user data?
Source: Internet
Author: User
PHP is safe. I 'd like to ask, how do I handle user data? PHP is safe. I 'd like to ask, how do I handle user data? Is there a standard common receiving function? Now it is basically: $ a =$ _ POST [& quot; a & quot;]; or $ a =$ _ GET [& quot; a & quot;]; how do I receive it? Or how do I say PHP Security? I want to ask, how do I handle user data?
PHP is safe. I 'd like to ask, how do I handle user data? Is there a standard common receiving function?
Now it's basically all:
$ A = $ _ POST ["a"];
Or
$ A = $ _ GET ["a"];
How do I receive it? Or how can I filter the data to make it safer? Because the SQL statement is executed. How to ensure security?
It is better to have a comprehensive function to process these requests.
1. special characters can be filtered to prevent SQL injection.
2. data such as POST, GET, COOKIE, and REQUEST can be received.
Do you have any questions to share?
------ Solution --------------------
Use the extract () function?
------ Solution --------------------
Discussion
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.