How to use magic_quotes_gpc_PHP tutorial

WBOY
Release: 2016-07-20 10:59:40
Original
875 people have browsed it

How to use magic_quotes_gpc

There are two situations for magic_quotes_gpc, the first one is

magin_quotes_gpc=on

with magin_quotes_gpc=off

Let’s give examples below.:

When magin_quotes_gpc=on.


We can not perform addslashes() and stripslashes() operations on the string data input and output from the database, and the data will be displayed normally.

If you perform addslashes() on the input data at this time, you must use stripslashes() to remove excess backslashes when outputting.

2. For the case of magic_quotes_gpc=off

Addslashes() must be used to process the input data, but there is no need to use stripslashes() to format the output because addslashes() does not write the backslashes together into the database, but only helps mysql complete the execution of the sql statement.

Supplement:

The scope of magic_quotes_gpc is: WEB client server; the time of action: when the request starts, such as when the script is running.
magic_quotes_runtime Scope of action: Data read from a file or the result of executing exec() or obtained from a SQL query; Action time: Every time the script accesses data generated in the running state


www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/445563.htmlTechArticleHow to use magic_quotes_gpc There are two situations for magic_quotes_gpc. The first one is magin_quotes_gpc=on and magin_quotes_gpc=off. Next we will Let’s give an example.: When magin_quotes_gpc=...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template