Heim  >  Artikel  >  Backend-Entwicklung  >  magic_quotes_gpc使用方法_PHP教程

magic_quotes_gpc使用方法_PHP教程

WBOY
WBOYOriginal
2016-07-20 10:59:40844Durchsuche

 

magic_quotes_gpc使用方法

 对于magic_quotes_gpc有两种情况,第一种就是

magin_quotes_gpc=on

与magin_quotes_gpc=off

 下面我们就来举列说明.:

当magin_quotes_gpc=on时.


我们可以不对输入和输出数据库的字符串数据作 ,addslashes()和stripslashes()的操作,数据也会正常显示。

如果此时你对输入的数据作了addslashes()处理,那么在输出的时候就必须使用stripslashes()去掉多余的反斜杠。

2. 对于magic_quotes_gpc=off 的情况

必须使用addslashes()对输入数据进行处理,但并不需要使用stripslashes()格式化输出 因为addslashes()并未将反斜杠一起写入数据库,只是帮助mysql完成了sql语句的执行。

补充:

magic_quotes_gpc 作用范围是:WEB客户服务端;作用时间:请求开始时,例如当脚本运行时.
magic_quotes_runtime 作用范围:从文件中读取的数据或执行exec()的结果或是从SQL查询中得到的;作用时间:每次当脚本访问运行状态中产生的数据


www.bkjia.comtruehttp://www.bkjia.com/PHPjc/445563.htmlTechArticlemagic_quotes_gpc使用方法 对于magic_quotes_gpc有两种情况,第一种就是 magin_quotes_gpc=on 与magin_quotes_gpc=off 下面我们就来举列说明.: 当magin_quotes_gpc=...
Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn
Vorheriger Artikel:写了个函数_PHP教程Nächster Artikel:图象函数_PHP教程