-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprocess.php
More file actions
36 lines (29 loc) · 782 Bytes
/
Copy pathprocess.php
File metadata and controls
36 lines (29 loc) · 782 Bytes
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
<?php
$filename = "SadakoOrderForm.csv";
$exists = (file_exists($filename));
$handle = fopen($filename, 'a');
$msg = "Thank you for placing your order.\n";//EMail message
$stringToAdd=""; //File into
if (!$exists){
foreach($_POST as $name => $value) {
$stringToAdd.="$name,";
}
$stringToAdd.="\n";
$new=False;
fwrite($handle, $stringToAdd);
}
$stringToAdd="";
foreach($_POST as $name => $value) {
print "$name : $value<br>";
$msg .="$name : $value\n";
$stringToAdd.="$value,";
}
$stringToAdd.="\n";
fwrite($handle, $stringToAdd);
//now close the file
fclose($handle);
$to = $_POST["Email"];
$headers = "From: ". $_POST["FirstName"] ."<".$_POST["Email"]. ">\r\n";
mail($to, 'SadakoOrderForm', $msg,$headers);
echo "Email sent";
?>