Skip to content
Snippets Groups Projects
Commit 561dec5f authored by David Miller's avatar David Miller
Browse files

Merge pull request #60 from demondayza/patch-1

Some Extra Validation and Variable Cleaning!
parents a1d81a3d 407d723b
No related branches found
No related tags found
No related merge requests found
...@@ -10,10 +10,10 @@ if(empty($_POST['name']) || ...@@ -10,10 +10,10 @@ if(empty($_POST['name']) ||
return false; return false;
} }
$name = $_POST['name']; $name = strip_tags(htmlspecialchars($_POST['name']));
$email_address = $_POST['email']; $email_address = strip_tags(htmlspecialchars($_POST['email']));
$phone = $_POST['phone']; $phone = strip_tags(htmlspecialchars($_POST['phone']));
$message = $_POST['message']; $message = strip_tags(htmlspecialchars($_POST['message']));
// Create the email and send the message // Create the email and send the message
$to = 'yourname@yourdomain.com'; // Add your email address inbetween the '' replacing yourname@yourdomain.com - This is where the form will send a message to. $to = 'yourname@yourdomain.com'; // Add your email address inbetween the '' replacing yourname@yourdomain.com - This is where the form will send a message to.
...@@ -23,4 +23,4 @@ $headers = "From: noreply@yourdomain.com\n"; // This is the email address the ge ...@@ -23,4 +23,4 @@ $headers = "From: noreply@yourdomain.com\n"; // This is the email address the ge
$headers .= "Reply-To: $email_address"; $headers .= "Reply-To: $email_address";
mail($to,$email_subject,$email_body,$headers); mail($to,$email_subject,$email_body,$headers);
return true; return true;
?> ?>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment