The escape function get_magic_quotes_gpc is unclear. Solution

Source: Internet
Author: User
The escape function get_magic_quotes_gpc is unclear. Generally, you can understand the get... _ gpc function. you can see the addslashes. Is it a function? = .. Array_walk has read several other w3c articles, which are uncertain. 1) the escape function get_magic_quotes_gpc is not clear.


Generally, you can understand the get... _ gpc function,
Generally, you can understand addslashes. Is it a function? = ..

Array_walk has read several w3c articles, which are uncertain,

1) Can you briefly explain the role of array_walk?
2) What does the code described in the image mean?
3) Can I replace it with the following statement?
If (! Get_magic_quotes_gpc ())
{
Addslashes ($ prot );
}

------ Solution --------------------
1) the array_walk () function applies a callback function to each element in the array. If the call succeeds, TRUE is returned. otherwise, FALSE is returned.

2) it is actually anti-SQL injection, adding a backslash to the pre-defined characters in The get/post values

3) No
------ Solution --------------------
1. on the same building

2. there is no need for addslashes to enable Magic reference. if it is not enabled, it is necessary to filter it before receiving the database.

3. the array_walk () filters both the post and get arrays. why?
------ Solution --------------------
Php 5.4 has removed this ini parameter and is unified. Don't worry about it. follow the method after 5.4. Otherwise, the code to be rewritten will be upgraded later.

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.