'', 'subjectMessage' => '', 'messageMessage' => ''); if(!isEmail($clientEmail)) { $array['emailMessage'] = 'Invalid email!'; } if($subject == '') { $array['subjectMessage'] = 'Empty subject!'; } if($message == '') { $array['messageMessage'] = 'Empty message!'; } if(isEmail($clientEmail) && $subject != '' && $message != '') { // Send email $headers = "From: " . $clientEmail . " <" . $clientEmail . ">" . "\r\n" . "Reply-To: " . $clientEmail; mail($emailTo, $subject . " (bootstrap contact form)", $message, $headers); } // The echo command just outputs text. So all this line is doing is displaying whatever is in the // array variable on the page. //echo json_encode($array); // This line basically uses javascript to throw up an alert confirming success & then redirects the user to // the main page of the site once they confirm the alert. You may need to change the URL if you move the files // out of the revamp folder (just remove the "revamp" from the URL. echo ''; } ?>