易截截图软件、单文件、免安装、纯绿色、仅160KB

php函数get_magic_quotes_gpc详解

set_magic_quotes_runtime是用来设置PHP 环境配置的变量 magic_quotes_runtime 值。
0-关闭 1-打开
程序中检测状态用get_magic_quotes_runtime,返回 0 表示关闭本功能;返回 1 表示本功能打开。若
magic_quotes_runtime 打开时,所有外部引入的数据库资料或者文件等等都会自动转为含有反斜线溢出字符的资料。

函数取得 PHP 环境配置的变量 magic_quotes_gpc (GPC, Get/Post/Cookie) 值。返回 0
表示关闭本功能;返回 1 表示本功能打开。当 magic_quotes_gpc 打开时,所有的 ' (单引号), " (双引号), \
(反斜线) and 空字符会自动加上转义符\;
默认情况下,PHP 指令magic_quotes_gpc为 on
,它主要是对所有的 GET、POST 和 COOKIE (即G P C)数据自动运行 addslashes()
。不要对已经被
magic_quotes_gpc
转义过的字符串使用 addslashes()
,因为这样会导致双层转义。遇到这种情况时可以使用函数 
get_
magic_quotes_gpc()
进行检测。

其实这个函数就是判断有PHP有没有自动调用addslashes
这个函数,
下面是例子,其实也是从手册上弄下来的,传过来就为自己看着方便,因为自己记性不好..
<
html
>
    <!--以POST方式传过去一个带有单引号的字符串 -->
    
<
body
>
         
<
form

action
="first.php"

method
="post"
>
              
<
input

type
="text"

name
="lastname"

value
="Simao'pig"
>
              
<
input

type
="submit"

value
="提交"
>
         
</
form
>
    
</
body
>
    
    
</
html
>
<?php

echo
get_magic_quotes_gpc
();  &nb


相关文档:

PHP获取浏览器信息(三种)

转自本人个人网站 【PHP探路者
】,欢迎各位访问站点!
在使用PHP获取浏览器信息时,通常有两种方式:
第一种是:使用$_SERVER[HTTP_USER_AGENT]选项
此方式获取的是格式不规则的数据,如
Mozilla/4.0 (compatible; MSIE 8.0
; Windows NT 5.1; Trident/4.0; GTB6; CIBA; .NET CLR 2.0.50727)
Mozilla/5.0 (Windows ......

从php编码习惯谈程序效率!


尽量使用单引号而不是双引号。
尽量使用带条件的include而不是require。
尽量使用echo而不是print。
尽量使用内嵌的HTML而不是echo。
尽量使用str-replace()而不是ereg-replace()。
尽量sql不用联合查询。
......

PHP 中巧用数组降低程序的时间复杂度

OpenX adserver version 2.8.1 and lower is vulnerable to remote code
execution. To be exploited, this vulnerability requires banner / file
upload permissions, such as granted to the 'advertiser' and
'administrator' roles.
This vulnerability is caused by the (insecure) file upload mechanism of
af ......

php中smarty模版引擎中的缓存应用!

1,Smarty缓存的配置:
   $smarty->cache-dir="目录名";   //创建缓存目录名
   $smarty->caching=true;   //开启缓存,为false的时候缓存无效
   $smarty->cache_lifetime=60; //缓存时间,单位是秒
2,Smarty缓存的使用与清除
   $marty->d ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号