Re: Error Generated but no error?

From: Date: Wed, 30 Mar 2005 11:29:37 +0000
Subject: Re: Error Generated but no error?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-211861@lists.php.net to get a copy of this message
Geoff Martin wrote:
I have a page that receives data from a form. Using $_POST['foo'], I am able to use this data in the page but I continually receive an error notice (PHP Notice: Undefined index: foo in /Library/WebServer/Documents/.. etc). This happens to all three indices that are passed by this form, yet the data IS appearing. How do I prevent these error messages?
You have two options, you can either [a] disable notices (by using error_reporting()) or [b] verify indices by using functions such as array_key_exists() etc.

« previous php.general (#211861) next »