Re: PHP saying I have an undefined variable?
- From: "FrobinRobin" <frobinrobin@xxxxxxxxxxx>
- Date: 20 Jun 2005 02:48:22 -0700
If you dont want to define the variable first - you can always use a
conditional to act if it doesnt exist:
if(!isset($varname))
{
do something
}
Or to supress the notices you can set the PHP error level reporting at
runtime using:
error_reporting(E_ALL ^ E_NOTICE);
That is; if you dont have access to your PHP.ini!
Regards
- FrobinRobin
ECRIA Public Mail Buffer wrote:
> Note that this is not an error but a notice - there's a difference. Errors
> will stop execution of your script, while warnings and notices are there to
> inform you of possible faulty code. Depending on your error_reporting
> setting in php.ini, you may or may not see warnings and notices. Your script
> has an undefined variable on your server but your server is just not telling
> you, because error_reporting is set to off or warn (not all).
>
> It is likely that you are using $end_while in a conditional statement before
> you have defined it, leading to the notice. You should set it to a default
> value at the beginning of your script, or before you use it.
>
> ECRIA
> http://www.ecria.com
.
- References:
- PHP saying I have an undefined variable?
- From: bissatch
- Re: PHP saying I have an undefined variable?
- From: ECRIA Public Mail Buffer
- PHP saying I have an undefined variable?
- Prev by Date: Re: Simple form but no output
- Next by Date: Re: concat 2 binary files?
- Previous by thread: Re: PHP saying I have an undefined variable?
- Next by thread: Re: links pointing on PHP manual not shown in error messages
- Index(es):
Relevant Pages
|