-
Notifications
You must be signed in to change notification settings - Fork 0
/
form.php
executable file
·50 lines (37 loc) · 1.51 KB
/
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
41
42
43
44
45
46
47
48
49
50
<?php if(!empty($_POST)) {
$email_to = "kanzaimmi@gmail.com";
$email_subject = "New message received from Kanzaï";
// test si la validation des données attendues existe
if(!empty($_POST['nom']) && !empty($_POST['email']) && !empty($_POST['message'])) {
$nom = $_POST['nom'];
$email = $_POST['email'];
$message = $_POST['message'];
$email_message = "Détail.\n\n";
$email_message .= "Nom: ".$nom."\n";
$email_message .= "Email: ".$email."\n";
$email_message .= "Messsage: ".$message."\n";
// create email headers
$headers = 'From: '.$email."\r\n".
'Reply-To: '.$email."\r\n" .
'X-Mailer: PHP/' . phpversion();
$retour = mail($email_to, $email_subject, $email_message, $headers);
if($retour){
echo "<script type='text/javascript'>
document.location.replace('index.html?f=yes#footer');
</script>";
}else{
echo "<script type='text/javascript'>
document.location.replace('index.html?f=no#footer');
</script>";
}
}else{
echo "<script type='text/javascript'>
document.location.replace('index.html?f=no#footer');
</script>";
}
}else{
echo "<script type='text/javascript'>
document.location.replace('index.html?f=no#footer');
</script>";
}
?>