Sorry for the vague Subject, but I have this code that looks fine to me. There's some logical error, because I can't get to the second if statement, although when I echo "\$".$cb[$i] I get $checkboxName. If I hard code $checkboxName it will work though. Anyone know why? TIA!
$num_fields= 8 ;//the number of fields on the form! $cb=array("Name", "Address", "State", "Zip", "Phone", "Email", "Comments", "Fax"); for($i=0; $i<$num_fields; $i++){ if ("\$".$cb[$i] !="") { // CAN GET HERE if ("\$checkbox".$cb[$i]=="validate") {echo"can NOT get here";// HINT, HINT $form_write_msg .= 'if (!$cb[$i]) {$error_msg.="Your " . $cb[$i] . " .\n";} if ("\$".$cb[$i]){ $msg.="\$".$cb[$i].": \t" . $cb[$i] . " . \n";} ' ;}elseif("\$checkbox".$cb[$i]=="no") {$form_write_msg.= 'if ("\$".$cb[$i]){ $msg.=$cb[$i] .": \t " .$cb[$i]. " . \n";} ' ;} ;} -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php