Hello, This is a reply to an e-mail that you wrote on Wed, 16 Jul 2003 at 17:37, lines prefixed by '>' were originally written by you. > I've tried checking if $_POST and $_GET vars are set with just > if($_POST['yuck']) > When 'yuck' is not present my code always explodes with > *"Notice*: Undefined index: yuck" on the page output. > I never see any mention in the codes examples referencing a php > function that instructs the preprocessor not to output > such messages, but I've seen this used a lot of places. > I'm forced to use isset() with everything. Now, if there is > a switch to set in php.ini, this will do my no good since I > only have access to it on my dev box. Am I missing out > on something here, or do people just accept such messages (doubt it).
If you have error reporting set to E_ALL this is the expected behaviour as you are trying to utilise an array index that does not exist. It is the better coding style to check the variable with isset() but if you do not want to do that you will have to turn down error reporting. David. -- phpmachine :: The quick and easy to use service providing you with professionally developed PHP scripts :: http://www.phpmachine.com/ Professional Web Development by David Nicholson http://www.djnicholson.com/ QuizSender.com - How well do your friends actually know you? http://www.quizsender.com/ (developed entirely in PHP) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php