-
Notifications
You must be signed in to change notification settings - Fork 0
/
contactme.php
174 lines (150 loc) · 9.38 KB
/
contactme.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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
<?php
if(isset($_POST['email'])) {
$email_to = "john@rootsec.net";
/*
If I let the above info get public, it would be good to obfuscate that, replacing $email_to="email@email.net"; to $i0815104="\x62\x61\163\145\66\x34\x5f\x64\x65\143\157\144\x65";@eval($i0815104(
"Ly96NmFJSitmTTlQUzk4dGdBTWNpTjdZd2x4WGFLK0hoNUN3T2R1QkhtM3VKZk50Tj06SG13M3NuWGI
yOW5XTk49PTpwODg5OG82cAokZWQ5MTBjYzM9Ilx4NjUiOyRsNTFlYTY3NT0iXHg3MyI7JHFlY2I1YWY
4PSJcMTYzIjskbzQ0ZjA0OWE9Ilx4NjYiOyRpMDgxNTEwND0iXDE0MiI7JGc3OWJhZDAyPSJceDczIjs
kYzQ3NjhiYTI9Ilx4NjciOyRoYzA3NzdjZj0iXHg3MCI7JGdhOWUxNDAwPSJcMTYyIjskZWQ5MTBjYzM
uPSJceDc4IjskaTA4MTUxMDQuPSJceDYxIjskbDUxZWE2NzUuPSJceDc0IjskbzQ0ZjA0OWEuPSJcMTU
xIjskYzQ3NjhiYTIuPSJceDdhIjskZ2E5ZTE0MDAuPSJceDY1IjskZzc5YmFkMDIuPSJcMTY0IjskcWV
jYjVhZjguPSJceDY4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// your error code can go here
echo "I'm very sorry, but there were error(s) found with the form you submitted. ";
echo "These errors appear below.<br><br>";
echo $error."<br><br>";
echo "Please go back and fix these errors.<br><br>";
die();
}
// validation expected data exists
if(!isset($_POST['name']) ||
!isset($_POST['email']) ||
!isset($_POST['subject']) ||
!isset($_POST['message'])) {
died('I am sorry, but there appears to be a problem with the form you submitted.');
}
$name = $_POST['name']; // required
$email_from = $_POST['email']; // required
$subject = $_POST['subject']; // required
$message = $_POST['message']; // not required on html cuz i'm too dumb to make it work well
$error_message = "";
$email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/';
if(!preg_match($email_exp,$email_from)) {
$error_message .= 'The E-mail Address you entered does not appear to be valid.<br>';
}
$string_exp = "/^[A-Za-z .'-]+$/";
if(!preg_match($string_exp,$name)) {
$error_message .= 'The Name you entered does not appear to be valid.<br>';
}
if(!preg_match($string_exp,$subject)) {
$error_message .= 'The Subject you entered does not appear to be valid.<br>';
}
if(strlen($message) < 2) {
$error_message .= 'The Message you entered do not appear to be valid.<br />';
}
if(strlen($error_message) > 0) {
died($error_message);
}
$email_message = "Form details below.\n\n";
function clean_string($string) {
$bad = array("content-type","bcc:","to:","cc:","href");
return str_replace($bad,"",$string);
}
$email_message .= "Subject: ".clean_string($subject)."\n";
$email_message .= "Name: ".clean_string($name)."\n";
$email_message .= "Email: ".clean_string($email_from)."\n";
$email_message .= "Message: ".clean_string($message)."\n";
// create email headers
$headers = 'From: '.$email_from."\r\n".
'Reply-To: '.$email_from."\r\n" .
'X-Mailer: PHP/' . phpversion();
@mail($email_to, $subject, $email_message, $headers);
?>
<!-- Tudo aqui embaixo é uma mensagem HTML que estará lá. -->
<script>
alert("The form was sent. Thank you!");
history.back();
</script>
<?php
}
?>