-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsendmail.php
More file actions
32 lines (30 loc) · 1.33 KB
/
sendmail.php
File metadata and controls
32 lines (30 loc) · 1.33 KB
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
<?php
include './connect.php' ;
session_start();
$name = $_POST['name'];
$Email = $_POST['Email'];
$PhoneNumber = $_POST['PhoneNumber'];
$Count = $_POST['Count'];
$date = $_POST['date'];
$Destination = $_POST['Destination'];
$trip_id = $_POST['trip_id'];
#Book The Trip
$sql = $db->prepare("Select trip_name , cost from trips where id=?");
$sql->execute(array($trip_id));
$row = $sql->fetch();
$trip_name = $row[0];
$trip_cost = $row[1];
$d=strtotime("today");
;
//Send Mail To Client
$sql = $db->prepare("INSERT INTO `booking`(`Client_Name`, `Email`, `Mobile`, `trip_name`, `Total_Money`, `Trip_Date`,`date`) VALUES (?,?,?,?,?,?,?)");
$sql ->execute(array($name,$Email,$PhoneNumber,$trip_name,$trip_cost,$date,("Y-m-d", $d)));
$message = "Dear LiveNippon , " . "Hi I'm " . $name . " And my PhoneNumber is " . $PhoneNumber . " and The People They Will Travel are " . $Count . " Person(s) And The Expected Date Is " . $date . " and The Destination Is " . $Destination . "my Email is " . $Email;
//$message = "Test 4";
// In case any of our lines are larger than 70 characters, we should use wordwrap()
$message = wordwrap($message, 70, "\r\n");
// Send
mail('test@t.com','LiveNippon', $message);
header('Location: index.php');
//Travel@livenippon.com
?>