|
Posted by Captain Paralytic on 06/26/07 14:24
On 26 Jun, 15:13, yaa...@gmail.com wrote:
> 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 ??
Try
if(!isset($_REQUEST["id"]) || empty($_REQUEST["id"])){
invalidArgs();
echo "buug";
}
Navigation:
[Reply to this message]
|