-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsend-education-form.php
40 lines (30 loc) · 1.27 KB
/
send-education-form.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
if(isset($_POST['email'])) {
$br = "\r\n";
$name = filter_input(INPUT_POST, "name", FILTER_SANITIZE_STRING);
$company = filter_input(INPUT_POST, "company", FILTER_SANITIZE_STRING);
$phone = filter_input(INPUT_POST, "phone", FILTER_SANITIZE_STRING);
$email = filter_input(INPUT_POST, "email", FILTER_VALIDATE_EMAIL);
$interest = filter_input(INPUT_POST, "interest", FILTER_SANITIZE_STRING);
$referer = $_SERVER["HTTP_REFERER"];
$to = "[email protected]";
$subject = "Contact from Trainings page";
$message = "A user has sent this data:". $br.$br;
$message .= "Имя, Фамилия: " . $name . $br;
$message .= "Компания: " . $company . $br;
$message .= "Телефон: " . $phone . $br;
$message .= "Email: " . $email . $br;
$message .= $br;
$message .= "The user is interested in: " . $br;
$message .= $interest . $br;
$message .= "at " . $referer . $br;
$header .= "MIME-Version: 1.0" . $br;
$header .= "From: VMGuru form service <[email protected]>" . $br;
$header .= "Content-Type: text/plain; charset=utf-8" . $br;
if(mail($to, $subject, $message, $header, "[email protected]")) {
header("Location: " . $_SERVER['HTTP_REFERER'],TRUE,301);
} else {
header("Location: " . $_SERVER['HTTP_REFERER'],TRUE,301);
}
}
?>