Created
May 23, 2014 15:44
-
-
Save innesm4/49e696b81b39105e9b10 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function clean($string){ | |
return htmlspecialchars(strip_tags($string)); | |
} | |
if (isset($_POST["send_enquiry"])) { | |
$response_array = array(); | |
$user_name = clean($_POST["user_name"]); | |
$user_company = clean($_POST["user_company"]); | |
$user_email = clean($_POST["user_email"]); | |
$user_message = clean($_POST["user_message"]); | |
$to = "EMAIL"; | |
$subject = "SUBJECT"; | |
$from = "From: [email protected]"; | |
$message = $user_name . " would like to find out more about you .\n\nName: " . $user_name . "\nCompany: " . $user_company . "\nEmail: " . $user_email . "\nMessage: " . $user_message; | |
mail($to,$subject,$message,$from); | |
$response_array['status'] = 'success'; | |
$response_array['message'] = 'Done'; | |
echo json_encode($response_array); | |
exit($encoded); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment