-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheckout_mail.php
49 lines (40 loc) · 1.48 KB
/
checkout_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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<!-- sends product order to company, then redirects to a success message screen -->
<?php
$name = $_POST['name'];
$email = $_POST['email'];
$address = $_POST['address'];
$city = $_POST['city'];
$country = $_POST['country'];
$result1 = $_POST['data1-price'];
$result2 = $_POST['data2-price'];
$result3 = $_POST['data3-price'];
$result4 = $_POST['data4-price'];
$count1 = $_POST['data1-count'];
$count2 = $_POST['data2-count'];
$count3 = $_POST['data3-count'];
// echo $name;
// echo $email;
// echo $address;
// echo $city;
// echo $country;
$message = "Name: " . $name . "\n" .
"Email: " . $email . "\n" .
"Address: " . $address . "\n" .
"City: " . $city . "\n" .
"Country: " . $country . "\n" .
"Product 1 " . $count1 . " " . $result1 . "\n" .
"Product 2 " . $count2 . " " . $result2 . "\n" .
"Product 3 " . $count3 . " " . $result3 . "\n" .
"Total: " . $result4;
// echo $message;
ini_set( 'display_errors', 1 );
error_reporting( E_ALL );
$from = "smtp.hostinger.com";
$to = "jmferna91@gmail.com, ttlacamila@gmail.com";
$subject = "Coffee Order";
// $message = "PHP mail works just fine";
$headers = "From:" . $from;
mail($to,$subject,$message, $headers);
// echo "The email message was sent.";
header("Location: ./order_success.php");
?>