Re: Yeah I'm sortof a noob

From: Date: Thu, 09 Oct 2008 18:27:29 +0000
Subject: Re: Yeah I'm sortof a noob
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-281652@lists.php.net to get a copy of this message
Please disregard It was a code fragment elsewhere that got put in when I went to save. Thank you for looking though! Frank Savant at Large ""Frank Stanovcak"" <blindspotpro@comcast.net> wrote in message news:CB.72.48736.9454EE84@pb1.pair.com... > 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 (#281652) next »