forked from marcinsdance/magentostudyguide.com
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathform.php
21 lines (21 loc) · 758 Bytes
/
form.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php
$subject = htmlspecialchars($_POST['subject']);
$suggestion = htmlspecialchars($_POST['suggestion']);
$name = htmlspecialchars($_POST['name']);
$email = htmlspecialchars($_POST['email']);
$signature = htmlspecialchars($_POST['signature']);
$message = <<<EOT
Name: {$name}
Email: {$email}
Subject: {$subject}
Suggestion: {$suggestion}
Signature: {$signature}
EOT;
$message = htmlspecialchars($message);
$subject = "Suggestion from the website";
$address = "info@magentostudyguide.com";
if(!mail($address, $subject, $message)) {
echo "<script>alert('There was an error submitting the form, please send us the information to: info@magestudyguide.com')</script>";
} else {
echo "<script>alert('Thank you for sending the suggestion!')</script>";
}