Yeah I'm sortof a noob

From: Date: Thu, 09 Oct 2008 17:58:30 +0000
Subject: Yeah I'm sortof a noob
Groups: php.general 
Request: Send a blank email to php-general+get-281650@lists.php.net to get a copy of this message
I'm trying to follow the three precepts of accepting user entries... 1. never trust it. 2. never trust it. 3. never trust it ever! I have one entry that may equal 0 on submission, and if it does is tripping a bool false result, so I came up with this work around. However when I put this in my code the page fails to load. What did I do wrong, and please be specific. I already know I'm stupid, and to answer the question. The extra ';' are for my clarity to know that is the end of the if or foreach statement. Plus it carried over from java script and keeps me out of trouble as I flip between the two. I am looking for the instance when the key is 'ExtraCases' as that is the field that will possibly be zero on submission. //check to make sure all the entries passed foreach($Filtered as $ThisKey => $ThisVar) { if($ThisVar == FALSE) { if(($ThisKey == 'ExtraCases') and (filter_has_var(INPUT_POST,'ExtraCases'))) { if($_POST['ExtraCases'] == 0) { $noProb = TRUE; } else { $Continue = FALSE; $WrongData[$ThisKey] = TRUE; }; } else { $Continue = FALSE; $WrongData[$ThisKey] = TRUE; }; }; };

« previous php.general (#281650) next »