$formerrors = true; } else { if (empty($myemail)) { $err_myemail = '<div class="error">Enter your Email</div>'; $formerrors = true; } else { if (empty($subject)) { $err_subject = '<div class="error">Enter your country/div>'; $formerrors = true; } else { if (empty($mycomments)) { $err_mycomments = '<div class="error">What do you want us to do for you</div>'; $formerrors = true; } else { $formdata = array('myname' => $myname, 'myemail' => $myemail, 'subject' => $subject, 'mycomments' => $mycomments); UserUtility::addContact($formdata); $msg = 'Thanks for filling out our form <a href="index.php">Back to home page</a> '; $to = "*****@*****.**"; $subject = "We need developers"; $message = "Our company is in need of two web designers and one java programmer."; //json_encode($formdata); //if(sendMail($to, $subject, $message)){ // $msg = "Thanks for filling out our form"; //}else{ // $msg = "Problem sending the message"; //} // mail form data } } } } }