-
Notifications
You must be signed in to change notification settings - Fork 0
/
engine.php
41 lines (35 loc) · 923 Bytes
/
engine.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
<?php
$From = "Starta-co New Website"
$destinataire = '[email protected]';
$subject = "Starta-co Contact Form";
$name = htmlspecialchars(stripcslashes($_POST['name1']));
$email = htmlspecialchars(stripcslashes($_POST['email']));
$message = htmlspecialchars(stripcslashes($_POST['msg']));
// Validation
$validationOK = true;
if( !$validationOK){
print "<meta http-equiv=\"refresh\" content=\"0;URL.contactError.php\">";
exit;
}
// Prepare The Email Body Text
$Body = "";
$Body .= "Name: ";
$Body .= $name;
$Body .= "\n";
$Body .= "Email : ";
$Body .= $email;
$Body .= "\n";
$Body .= "Message ";
$Body .= $message;
//Send Email
$success = mail ($destinataire, $subject, $Body, "From: Mr/Mm <$name>");
// Redirect To Success Page
if($success)
{
print "<meta http-equiv=\"refresh\" content=\"0;URL=contactThanks.php\">";
}
else
{
print "<meta http-equiv=\"refresh\" content=\"0;URL=contactError.php\">";
}
?>