RE: [PHP] How to define varibles

From: Date: Sat, 25 Nov 2000 23:16:46 +0000
Subject: RE: [PHP] How to define varibles
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-27196@lists.php.net to get a copy of this message
isset() works like a charm. Thank you very much. Jason -----Original Message----- From: Ignacio Vazquez-Abrams [mailto:ignacio@openservices.net] Sent: Saturday, November 25, 2000 5:06 PM To: jcrowe Cc: php-general@lists.php.net Subject: Re: [PHP] How to define varibles On Sat, 25 Nov 2000, jcrowe wrote: > I am new at php ('bout 2 days now) I have made a page that submits a form to > itself but I am getting the following warnings. > > Warning: Undefined variable: > > I know that this is caused by the error settings in php.ini and I have > changed it on my local machine but the hosting company has not changed this > setting on there boxes. > > My question is Can I work around this somehow? Is there a way to Define the > Varibles? > I know that in cold fusion you can set a varible to NULL if it doesn't have > a value. anything similar in php? > > Thanks, > Jason > Three things: 1) Use error_reporting() to exclude warnings. (Bad Idea) 2) Assign false to the variable first. (Not Quite As Bad An Idea) 3) Use isset() to detect whether or not a variable exists before reading from it. (What I Do) -- Ignacio Vazquez-Abrams <ignacio@openservices.net> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#27196) next »