Re: Notices - Variable not defined
| From: | John W. Holmes | Date: | Sat, 06 Sep 2003 02:27:51 +0000 |
| Subject: | Re: Notices - Variable not defined | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-161839@lists.php.net to get a copy of this message | ||
Leonie wrote:
I have this code: if (!$path) { $path = getPath(); } Sometimes $path is set (there are forms on the page that can change it). When the page is first displayed: Notice: Undefined variable: path in e:\program/ etc... It then gives a reference to the line: if (!$path) { Is there a way to get rid of this annoying notice?if(!isset($path)) { $path = getPath(); } -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.com