error-logs()bug ?? [英] error-logs() bug ??

查看:82
本文介绍了error-logs()bug ??的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好!!我有error_logs的问题。问题在于这个

代码:


$ id_tmp = $ _REQUEST [" id"];

if(! isset($ id_tmp)&& empty($ id_tmp)){

invalidArgs();

echo" buug";

}


我想检查变量id是否通过GET方法传递给

脚本。如果没有,函数invalidArgs()将启动。

函数invalidArgs()我抛出异常InvalidArgsException。我使用

set_exception_handler();设置整个脚本的处理程序来管理异常。功能。我通过error_log将错误写入

文件,并显示参数id未通过的警告页面。


问题在于我在www浏览器中打开这个页面IE6和

把正确的参数id一切正常,假设的页面是

显示但是在文件中写入了错误(通过error_logs ),是否是
出现InvalidArgsException错误?这真的很奇怪

,因为脚本不会进入if-block并启动

函数invalidArgs()。有什么问题,为什么error_log会写错误

,这并不是什么意思?一切正常,页面和脚本的其余部分就像是从GET

方法中获取id参数,但是在error_log文件中有条目吗?

解决方案

id_tmp =


_REQUEST [" id"];

if(!isset(


id_tmp)&& empty(


Hello !! I have a problem with error_logs. The problem is in this
code:

$id_tmp = $_REQUEST["id"];
if(!isset($id_tmp) && empty($id_tmp)){
invalidArgs();
echo "buug";
}

I''d like to check if the variable id is passed by GET method to the
script. If not, function invalidArgs() will start.
In function invalidArgs() I thrown exception InvalidArgsException. I
set a handler for whole script to manage exceptions using
set_exception_handler(); function. I write, by error_log, errors to
file and show warning page that the parameter id isn''t pass through.

And the problem is that when I open this page in www browser IE6 and
put correct parameter id everything is ok, the page that suppose to is
showing but in file where errors are written (by error_logs), are
appeared errors of InvalidArgsException ?? That''s really weird
because the script doesn''t suppose to get into if-block and start
function invalidArgs(). What is wrong, why error_log writes an errors
that doesn''t suppose to ?? Everything work correct, the page and the
rest of the script acts like it gets the id parameter from GET
methods, but there is entry in error_log file ??

解决方案

id_tmp =


_REQUEST["id"];
if(!isset(


id_tmp) && empty(


这篇关于error-logs()bug ??的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆