一、magic_quotes_gpc = Off
有这样的一个html页面
其中text控件命名为:asd/f'gh/a.b.c/ ,将此页面提交到1.php进行处理,method用get还是post方法无所谓。
1.php
输入ssssssss点击提交,显示:
--------------------------------------------------------
Array ( [asd/f'gh/a_b_c/] => ssssssss )
ssssssss
--------------------------------------------------------
总结:input控件命名中的点号变为下划线。
另注:asp中input控件命名中的点号不变,取变量可用:Request.QueryString("asd/f'gh/a.b.c/")
二、magic_quotes_gpc = On
1.php改为
提交后显示:
----------------------------------------------------------
Array ( [asd/f/'gh/a_b_c/] => ssssssss )
ssssssss
----------------------------------------------------------
总结:input控件命名中的点号变为下划线;并且单引号被自动加上一个反斜线进行转义,所以名字中增加了反斜线,在php中取传递来的值时要对GET变量名中的反斜线进行转义。
有这样的一个html页面
<
form
action
='1.php'
method
='get'
>
< input type ='text' name =asd/f'gh/a.b.c />
< input type ='submit' value ='submit' >
</ form >
< input type ='text' name =asd/f'gh/a.b.c />
< input type ='submit' value ='submit' >
</ form >
1.php
<?
php
print_r ( $_GET );
echo ' <br> ' ;
print $_GET [ ' asd/f/'gh/a_b_c/ ' ]
?>
print_r ( $_GET );
echo ' <br> ' ;
print $_GET [ ' asd/f/'gh/a_b_c/ ' ]
?>
--------------------------------------------------------
Array ( [asd/f'gh/a_b_c/] => ssssssss )
ssssssss
--------------------------------------------------------
总结:input控件命名中的点号变为下划线。
另注:asp中input控件命名中的点号不变,取变量可用:Request.QueryString("asd/f'gh/a.b.c/")
二、magic_quotes_gpc = On
1.php改为
<?
php
print_r ( $_GET );
echo ' <br> ' ;
print $_GET [ ' asd/f///'gh/a_b_c/ ' ]
?>
print_r ( $_GET );
echo ' <br> ' ;
print $_GET [ ' asd/f///'gh/a_b_c/ ' ]
?>
----------------------------------------------------------
Array ( [asd/f/'gh/a_b_c/] => ssssssss )
ssssssss
----------------------------------------------------------
总结:input控件命名中的点号变为下划线;并且单引号被自动加上一个反斜线进行转义,所以名字中增加了反斜线,在php中取传递来的值时要对GET变量名中的反斜线进行转义。