Where is phpaddslashes used? why? What should I do?
Source: Internet
Author: User
Where is phpaddslashes used? why? Where is phpaddslashes used? why ?, Escape predefined characters. Where can I use php addslashes? why?
Where is php addslashes used? why?
------ Solution --------------------
Escape predefined characters.
Http://www.w3school.com.cn/php/func_string_addslashes.asp
------ Solution --------------------
Prevent users from entering "test or 1 = 1" in the input box. Is to prevent SQL injection.
------ Solution --------------------
In order to avoid '\ 0',', ", \,; these characters affect SQL statement parsing, because \ 0 in C is the end of a string, and in Mysql :', "is used for the package field name, \ is an escape, all have special meanings, so add a \ to let Mysql ignore their special meanings.
------ Solution --------------------
Simply put, it is to filter illegal characters to prevent some computer experts from intruding into your database.
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.