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",
for($i=0; $i<$num_fields; $i++){

if ("\$".$cb[$i] !="")
 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";}
   'if ("\$".$cb[$i]){
      $msg.=$cb[$i]  .": \t " .$cb[$i]. " . \n";}

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to