-
Notifications
You must be signed in to change notification settings - Fork 6
/
contact.php
28 lines (24 loc) · 1015 Bytes
/
contact.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
<?php
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
$from = 'From: loris.ca';
$to = '[email protected]';
$subject = 'A new message from loris.ca contact form';
$human = $_POST['human'];
$body = "From: $name\n E-Mail: $email\n Message:\n $message";
if ($_POST['submit']) {
if ($name != '' && $email != '') {
if (mail ($to, $subject, $body, $from)) {
print '<p>Your message has been sent</p><p>(page will reload in 5 seconds)</p>';
header('Refresh: 5; url=http://3design-dlo.com/test/loris/contact.html');
} else {
print '<p>Something went wrong, please try again!</p><p>(page will reload in 5 seconds)</p>';
header('Refresh: 5; url=http://3design-dlo.com/test/loris/contact.html');
}
} else {
print '<p>Not sent. Please fill all required fields</p><p>(page will reload in 5 seconds)</p>';
header('Refresh: 5; url=http://3design-dlo.com/test/loris/contact.html');
}
}
?>