Re: [DOC-NL] PHP variable
[email protected] (Derick Rethans)
| Newsgroups | php.doc.nl |
|---|---|
| Message-ID | <[email protected]> |
On Mon, 18 Nov 2002, F.Anneveld wrote: > Hello, > > When I use the following code my browser comes with the following error : > -------------------------------------------------------------------- > PHP code: > > <?php > if (!$test) echo "test does not exist"; > ?> > -------------------------------------------------------------------- > Browser error: > > Notice: Undefined variable: test in d:\www\trash.php on line 3 > test does not exist > > -------------------------------------------------------------------- > But in PHP you don't have to declare a variable > or do I have to ajust some setting in the PHP.ini ???? You should always test if a variable is set with isset(), but if you want to be sloppy with your code you can change your error reporting level (php.net/error_reporting). Further, this list is NOT for support questions, which belong on the [email protected] mailing list. Derick -- --------------------------------------------------------------------------- Derick Rethans http://derickrethans.nl/ JDI Media Solutions http://www.jdimedia.nl/ ---------------------------------------------------------------------------