Re: Sudden variable problems

From: Date: Thu, 28 Sep 2000 16:33:25 +0000
Subject: Re: Sudden variable problems
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-17926@lists.php.net to get a copy of this message
> Im running php 4 on my webserver. I have developed some forms in php which worked just fine > until yesterday. Suddenly php was writing out errors when i tried to print out variables that were > not set. I had to rewrite all my forms from this > > print "$variable"; If you are just printing a variable like that there is no reason to put quotes around them. Just do: print $variable; > to this > > if( isset( $variable ) ) print "$variable"; > > No changes had been done to php on the server prior to this problem, so why this problem > occured is an enigma to me. > > Anyone with any proposals to what may cause this or how to fix it, are welcome with > suggestions. You must have changed the error reporting level. Perhaps you deleted your php.ini file and restarted the server, or you put a php.ini file in place a while ago and restarted your server yesterday. Basically what has happened is that E_NOTICE warnings are being displayed now. This includes warnings about using uninitialized variables. Edit your php.ini file and set your error_reporting to: error_reporting = E_ALL & ~E_NOTICE which will give you all errors except E_NOTICE ones. -Rasmus

« previous php.general (#17926) next »