-
Notifications
You must be signed in to change notification settings - Fork 0
/
mail.php
34 lines (29 loc) · 1.07 KB
/
mail.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
<?php
include('connection.php');
$email = $_SESSION['email'];
$c_id = $_GET['c_id'];
$conf = "select * from confirmedride where c_id=$c_id";
$showconf = mysqli_query($con,$conf);
$confdata = mysqli_fetch_array($showconf);
$demail = $confdata['driver_email'];
$dr = "select * from details where mail='$email'";
$showdr = mysqli_query($con,$dr);
$arrdata = mysqli_fetch_array($showdr);
$name = $arrdata['name'];
$num = $arrdata['num'];
$to_email = "$demail";
$subject = "About your Offered Ride.";
$body = "Hi, {$name} has selected your ride. For contact {$name}, number is {$num} and E-mail id is {$email}. ";
$headers = "From: [email protected]";
if (mail($to_email, $subject, $body, $headers)) {
echo "<script type=\"text/javascript\">\n";
echo "alert('Email successfully sent to provider.');\n";
echo "window.location = ('main.php');\n";
echo "</script>";
} else {
echo "<script type=\"text/javascript\">\n";
echo "alert('Email sending Fail...');\n";
echo "window.location = ('displayride.php');\n";
echo "</script>";
}
?>