-
Notifications
You must be signed in to change notification settings - Fork 0
/
form-post.php
99 lines (78 loc) · 2.25 KB
/
form-post.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<?php
use com\bdmdata\common as Common;
include "app/includes/common/Forms.Class.php";
include "app/includes/common/Mail.Class.php";
//debug on
ini_set('display_errors', 1);
// define variables and set to empty values
$name = $surname = $email = $tel = $mobile = $message = "";
// $cf = new Common\Form;
if ($_SERVER["REQUEST_METHOD"] == "POST") {
// if ($_POST["name"]=="") {
// $nameErr = "Name is required";
// } else {
// $name = cf::validateName($_POST["name"]);
// }
// if ($_POST["name"]=="") {
// $nameErr = "Name is required";
// } else {
$name = $_POST["name"];
// }
$surname = $_POST["surname"];
// if ($_POST["email"]=="") {
// $emailErr = "Email is required";
// $email = "";
// } else {
if (isset($_POST["email"])){
$email = $_POST["email"];
}
// }
// if ($_POST["comment"]=="") {
// $comment = "";
// } else {
if (isset($_POST["comment"])){
$message = $_POST["comment"];
}
}
?>
<!doctype HTML>
<html>
<body>
<?php
// include "app/includes/common/mail.php";
// $From = '[email protected]';
// $Recipient = '[email protected]';
// $Subject = $name . 'has filled out your contact form';
// $Body ='
// Hi,
// You have a new message submitted on your website.
// Name ' . $name . ' '. $surname
// 'Email' .$email . ' ' .
// 'Tel' . $tel . ' ' .
// 'Cel' . $mobile . ' ' .
// 'Message' . $message;
// $Signature = PHP_EOL. 'New Message from - domain Contact Form';
// $cf_mail = new Common\Email($From,$Recipient,$Subject,$Body,$Signature);
// $cf_mail->send();
include "app/includes/log.php";
//debug
// if ($_SERVER["REQUEST_METHOD"] == "POST"){
// echo "Name " . $_POST['name'];
// echo "Surname " . $_POST['surname'];
// echo "Email " . $_POST['email'];
// echo "Tel " . $_POST['tel'];
// echo "Cel " . $_POST['mobile'];
// echo "Message " . $_POST['message'];
// Print All Messages
// print_r($_POST);
echo "Name " . $name . PHP_EOL;
echo "Surname " . $surname . PHP_EOL;
echo "Email " . $email . PHP_EOL;
echo "Tel " . $tel . PHP_EOL;
echo "Cel " . $mobile . PHP_EOL;
echo "Message " . $message . PHP_EOL;
write_log('new message '. ' ' . $_POST['name'] . ' ' . $_POST['surname']);
// }
?>
</body>
</html>