几个小问题,急,只好请教各位了

oirin 2005-09-26 02:03:41
大家好,问题如下:
1, error_reporting(0);
2, set_magic_quotes_runtime(0);
3, get_magic_quotes_gpc();
4, @ini_get('register_globals');
这四句分别是什么意思,实在不懂,请教大家一下!!!
...全文
64 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
xuzuning 2005-09-26
  • 打赏
  • 举报
回复
1, error_reporting(0);
关闭错误检测,不报告可能出现的错误

2, set_magic_quotes_runtime(0);
默认如此。关闭在操作文件和数据库的自动转义

3, get_magic_quotes_gpc();
取得当前magic_quotes_gpc开关的状态

4, @ini_get('register_globals');
取得当前的register_globals开关状态
piner 2005-09-26
  • 打赏
  • 举报
回复
1. Turn off all error reporting
2.set_magic_quotes_runtime -- Sets the current active configuration setting of magic_quotes_runtime(0 for off, 1 for on)
3.See also: get_magic_quotes_gpc() and get_magic_quotes_runtime()
4.ini_get -- Gets the value of a configuration option
<?php
/*
Our php.ini contains the following settings:

display_errors = On
register_globals = Off
post_max_size = 8M
*/

echo 'display_errors = ' . ini_get('display_errors') . "\n";
echo 'register_globals = ' . ini_get('register_globals') . "\n";
echo 'post_max_size = ' . ini_get('post_max_size') . "\n";
echo 'post_max_size+1 = ' . (ini_get('post_max_size')+1) . "\n";

?>

This script will produce:

display_errors = 1
register_globals = 0
post_max_size = 8M
post_max_size+1 = 9


jimmyzhan 2005-09-26
  • 打赏
  • 举报
回复
1, error_reporting(0); //设定错误报告的等级为0(不显示错误)
2, set_magic_quotes_runtime(0);//设定"魔法引用"为OFF(也就是不自动进行字符转义)
3, get_magic_quotes_gpc(); //获得"魔法引用"的状态(打开还是关闭)
4, @ini_get('register_globals'); //获得php.ini相应设置的状态."@"表示屏蔽错误.

/*
*以上不知对不对? 最好还是自己看手册
*/

21,886

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧