-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfeedback.php
More file actions
51 lines (45 loc) · 2.07 KB
/
Copy pathfeedback.php
File metadata and controls
51 lines (45 loc) · 2.07 KB
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
<?php
if (isset ($_POST['txtemail'])) {
$to = "freellproject@gmail.com";
$from = $_POST['txtemail'];
$txtphone = $_POST['txtphone'];
$subject = "Ïðåäëîæåíèå î ðàáîòå. Çàïîëíåíà êîíòàêòíàÿ ôîðìà ñ ".$_SERVER['HTTP_REFERER'];
$message = "Èìÿ îòïðàâèòåëÿ: ".$_POST['txtname']."\n Email: ".$from. "\nÒåëåôîí: ".$txtphone."\nÑîîáùåíèå: ".$_POST['message']."\nIP àäðåññ îòïðàâèòåëÿ: ".$_SERVER['REMOTE_ADDR'];
$boundary = md5(date('r', time()));
$filesize = '';
$headers = "MIME-Version: 1.0\r\n";
$headers .= "From: " . $from . "\r\n";
$headers .= "Reply-To: " . $from . "\r\n";
$headers .= "Content-Type: multipart/mixed;charset=\"utf-8\"; boundary=\"$boundary\"\r\n";
$message="
Content-Type: multipart/alternative; boundary=\"$boundary\"
--$boundary
Content-Type: text/plain; charset=\"utf-8\"
Content-Transfer-Encoding: quoted-printable
$message";
for($i=0;$i<count($_FILES['file']['name']);$i++) {
if(is_uploaded_file($_FILES['file']['tmp_name'][$i])) {
$attachment = chunk_split(base64_encode(file_get_contents($_FILES['file']['tmp_name'][$i])));
$filename = $_FILES['file']['name'][$i];
$filetype = $_FILES['file']['type'][$i];
$filesize += $_FILES['file']['size'][$i];
$message.="
--$boundary
Content-Type: \"$filetype\"; name=\"$filename\"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename=\"$filename\"
$attachment";
}
}
$message.="
--$boundary--";
if ($filesize < 10000000) { // ïðîâåðêà íà îáùèé ðàçìåð âñåõ ôàéëîâ. Ìíîãèå ïî÷òîâûå ñåðâèñû íå ïðèíèìàþò âëîæåíèÿ áîëüøå 10 ÌÁ
mail($to, $subject, $message, $headers);
/* echo $_POST['txtname'].', Âàøå ñîîáùåíèå ïîëó÷åíî, ñïàñèáî!'; */
echo '<script language="JavaScript">alert("Âàøå ñîîáùåíèå äîñòàâëåíî!");location.href="http://freepj.890m.com";</script>';
} else {
/* echo 'Èçâèíèòå, ïèñüìî íå îòïðàâëåíî. Ðàçìåð âñåõ ôàéëîâ ïðåâûøàåò 10 ÌÁ.';*/
echo '<script language="JavaScript">alert("Èçâèíèòå, ïèñüìî íå îòïðàâëåíî. Ðàçìåð âñåõ ôàéëîâ ïðåâûøàåò 10 ÌÁ.");location.href="http://freepj.890m.com";</script>';
}
}
?>