This repository has been archived by the owner on Sep 1, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbookingmailer.php
67 lines (59 loc) · 2.57 KB
/
bookingmailer.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<html>
<body>
<?php
if (isset($_POST['action'])){
$_POST['action']="undefine";
}
$to = "[email protected]";
$from = $_REQUEST['contactform-email'] ;
$name = $_REQUEST['contactform-fullname'] ;
$headers = "From: $from";
$subject = "Website Booking Form" ;
$fields = array();
$fields{"contactform-fullname"} = "Full Name";
$fields{"contactform-email"} = "Email Address";
$fields{"contactform-contactnumber"} = "Contact Number";
$fields{"contactnumber"} = "Contact Number";
// Next Form-Group
$fields{"contactform-howmanytraveling"} = "How Many Traveling";
$fields{"contactform-childseats"} = "Child Seats Required";
$fields{"contactform-destination"} = "Destination";
// Next Form-Group
$fields{"contactform-luggage"} = "Luggage Quantity and Type";
// Next Form-Group
$fields{"contactform-dateofpickup"} = "Date of Pickup";
$fields{"contactform-timeofpickup"} = "Time of Pickup";
$fields{"contactform-flightnumber"} = "Flight Number";
// Next Form-Group
$fields{"contactform-pickupaddress"} = "Pickup Addresses";
// Next Form-Group
$fields{"contactform-returndate"} = "Return Date";
$fields{"contactform-returntime"} = "Return Time";
$fields{"contactform-returnflightnumber"} = "Return Flight Number";
// Next Form-Group
$fields{"contactform-comments"} = "Comments and Requirements";
$body = "We have received the following information:\n\n";
foreach($fields as $a => $b){
$body .= sprintf("%20s: %s\n",$b,$_REQUEST[$a]);
}
$headers2 = "From: [email protected]";
$subject2 = "Thank you for your enquiry";
$autoreply = "Thank you for your enquiry. Somebody will get back to you as soon as possible, usualy within 48 hours.";
if($from == ''){
print "You have not entered an email, please go back and try again";
} else {
if($name == ''){
print "You have not entered a name, please go back and try again";
} else {
$send = mail($to, $subject, $body, $headers);
$send2 = mail($from, $subject2, $autoreply, $headers2);
if($send){
header( "Location: http://mikesairportcars.co.uk/thankyou.html" );
} else {
print "We encountered an error sending your mail, please notify [email protected]";
}
}
}
?>
</body>
</html>