Re: PHP variable

From: Date: Tue, 19 Nov 2002 12:38:50 +0000
Subject: Re: PHP variable
References: 1  Groups: php.doc.nl 
Request: Send a blank email to doc-nl+get-167@lists.php.net to get a copy of this message
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 php-general@lists.php.net mailing list. Derick -- --------------------------------------------------------------------------- Derick Rethans http://derickrethans.nl/ JDI Media Solutions http://www.jdimedia.nl/ ---------------------------------------------------------------------------

« previous php.doc.nl (#167) next »