I am checking the values of a submited forms for empty fields with the code
below. My problem is that the echo statement is being executed once
regardless of whether or not the if statement is true. What am I missing?
thanks,
loopjunkie
---- snip ----
/* variables in array set earlier in script */
$userVars = array($nameFirst, $nameLast, $pass, $pass2, $auth, $dob_year,
$dob_month, $dob_day);
for ($i=0; $i <= count($userVars); $i++) {
if (empty($userVars[$i])) {
echo "please enter all required info";
break;
}
}
--- snip ----
_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*.
http://join.msn.com/?page=features/featuredemail
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
- Re: [PHP] nested if in a for statement James Brennan
- Re: [PHP] nested if in a for statement Tim Ward
- RE: [PHP] nested if in a for statement Edward Peloke
- [PHP] Re: nested if in a for statement Kyle Gibson
- [PHP] Re: nested if in a for statement Kyle Gibson
- Re: [PHP] nested if in a for statement Douglas Douglas
- Re: [PHP] nested if in a for statement Kevin Stone
- Re: [PHP] nested if in a for statement Kevin Stone