RE: [PHP] PHP Notice: Undefined index

From: Date: Fri, 19 May 2006 23:15:27 +0000
Subject: RE: [PHP] PHP Notice: Undefined index
Groups: php.general 
Request: Send a blank email to php-general+get-236541@lists.php.net to get a copy of this message
> Any idea why this bit of code > > if("yes" == $_POST['submitter']) > { > mysql_select_db($db,$myconnection); > > $sql = "INSERT INTO > $db.$table > (name,email,comments,entrydate) > values > ('$name','$email','$comments','$entrydate')"; > mysql_query($sql) or die(print mysql_error()); > } > > is provoking this message in my Apache error log? > > [Fri May 19 19:05:10 2006] [error] PHP Notice: Undefined index: > submitter in > /home/jtjohnston/domains/jtjohnston.ca/public_html/comments.php on line 29 "Undefined index" means that the index does not exist, ie: the "submitter" value is not being set when the form is posted. Check the form that is posting the data and make sure that there is a value for "submitter". FWIW, usually when I get this error it's because I managed to spell something wrong.. HTH, Brady

« previous php.general (#236541) next »