Notice: Undefined index

This is a discussion on Notice: Undefined index within the Apache Web Server forums, part of the Web Server and Related Forums category; What is the directive to avoid having the notice: Notice: Undefined index... When a variable is not declared....


Go Back   Usenet Forums > Web Server and Related Forums > Apache Web Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-24-2007
Alfred Wallace
 
Posts: n/a
Default Notice: Undefined index

What is the directive to avoid having the notice:

Notice: Undefined index...

When a variable is not declared.





  #2 (permalink)  
Old 01-24-2007
Rik
 
Posts: n/a
Default Re: Notice: Undefined index

On Wed, 24 Jan 2007 12:16:35 +0100, Alfred Wallace <popup@free.Fr> wrote:

> What is the directive to avoid having the notice:
>
> Notice: Undefined index...
>
> When a variable is not declared.


To check wether it's declared before you use it, or set it to an empty
value at first.
--
Rik Wasmus
  #3 (permalink)  
Old 01-24-2007
Alfred Wallace
 
Posts: n/a
Default Re: Notice: Undefined index

What about setting:


error_reporting = E_ALL & ~E_NOTICE

in php.ini??



"Rik" <luiheidsgoeroe@hotmail.com> a écrit dans le message de news:
op.tmnoibhiqnv3q9@misant...
> On Wed, 24 Jan 2007 12:16:35 +0100, Alfred Wallace <popup@free.Fr> wrote:
>
>> What is the directive to avoid having the notice:
>>
>> Notice: Undefined index...
>>
>> When a variable is not declared.

>
> To check wether it's declared before you use it, or set it to an empty
> value at first.
> --
> Rik Wasmus



  #4 (permalink)  
Old 01-24-2007
Rik
 
Posts: n/a
Default Re: Notice: Undefined index

On Wed, 24 Jan 2007 14:02:31 +0100, Alfred Wallace <popup@free.Fr> wrote:
> "Rik" <luiheidsgoeroe@hotmail.com> a écrit dans le message de news:
> op.tmnoibhiqnv3q9@misant...
>> On Wed, 24 Jan 2007 12:16:35 +0100, Alfred Wallace <popup@free.Fr>
>> wrote:
>>
>>> What is the directive to avoid having the notice:
>>>
>>> Notice: Undefined index...
>>>
>>> When a variable is not declared.

>>
>> To check wether it's declared before you use it, or set it to an empty
>> value at first.

> What about setting:
>
>
> error_reporting = E_ALL & ~E_NOTICE
>
> in php.ini??


As I suspected it's a PHP issue, so this has nothing to do here in
alt.apache.configuration.
Cross-posted to comp.lang.php, folluw-up to comp.lang.php.

1. Changing the error_reporting level to exclude E_NOTICS does not mean
there is none, just that you don't see it.
2. Notices are there for a reason. It's a sign of sloppy code. Code
correctly and you'll have none.
3. I'd even go as far as to say you that you shouldn't even have E_STRICT
warnings.

Take advantage of the notices given to you by PHP, your code will
(usually) be better for it.
--
Rik Wasmus
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 09:56 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0