This repository was archived by the owner on Oct 11, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsendmail.php
67 lines (62 loc) · 3.34 KB
/
sendmail.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
<div id='content'>
<?error_reporting(0);
if (isset($_POST['submit']) && isset($_POST['subject']) && isset($_POST['message'])){
if(strlen($_POST['message'])>7 && strlen($_POST['message'])<1000){
$message=stripinput($_POST['message']);
if (isset($_FILES["screen"]) && is_uploaded_file($_FILES["screen"]["tmp_name"]) && $_FILES["screen"]["error"] == 0) {
$photo_types = array(".gif",".jpg",".jpeg",".png",".bmp");
$screen = $_FILES["screen"]["name"];
$photo_ext = strtolower(strrchr($screen,"."));
if(in_array($photo_ext, $photo_types)){
if ($_FILES["screen"]["size"] < 2000000){
$screen_id = $_FILES["screen"]["name"];
$save_path = "upload/".$ac_id."_".$_FILES["screen"]["name"];
@move_uploaded_file($_FILES["screen"]["tmp_name"],$save_path);
$message.="<br><br>Screenshot<br>$cp_url$save_path<br>";
}
}
}
$result = dbquery("SELECT email,username FROM account WHERE id='$ac_id' limit 1");
if (dbrows($result) != 0) {
$data = dbarray($result);
send_mail(''.$data['username'].'',''.$data['email'].'',0,0,'sendmail',''.stripinput($_POST['subject']).'',''.$message.'');
echo'<h2>Ïèñüìî '.$admin_name.'`ó</h2><p><div class="log_error">Ñîîáùåíèå óñïåøíî îòïðàâëåíî</div></p>';
}
}else echo'<h2>Ñîîáùåíèå îá îøèáêå</h2>
<p><div class="log_error">Íå çàïîëíåíû îáÿçàòåëüíûå ïîëÿ ôîðìû èëè ñîîáùåíèå ñëèøêîì äëèííîå</div><br><a href="?p=18">Âåðíóòüñÿ îáðàòíî</a></p>
';
}else{
echo'<h2>Íàïèñàòü '.$admin_name.'`ó</h2>
<p>
<form name="sendmail" method="post" enctype="multipart/form-data">
<table border="0" cellpadding="0" cellspacing="0" class="tbl" width="100%">
<tr>
<td colspan="2">Ñîîáùåíèÿ, îòïðàâëåííûå ÷åðåç ýòó ôîðìó, íàïðàâëÿþòñÿ íà '.$admin_email.'. Ñîîáùåíèå íå îòñëåæèâàåòñÿ â "Èñòîðèè îáðàùåíèé ê Àäìèíèñòðàöèè ñåðâåðà". Îòâåò âû ïîëó÷èòå íà ýëåêòðîííóþ ïî÷òó, àäðåñ êîòîðîé óêàçàí â äàííûõ âàøåãî àêêàóíòà.</td>
</tr>
<tr height="25">
<td colspan="2"></td>
</tr>
<tr>
<td align="right" width="40%">Òåìà ñîîáùåíèÿ<span class="red">*</span>:</td>
<td width="60%"><input name="subject" type="text" class="inp" size="15" style="width: 300px;"></td>
</tr>
<tr>
<td align="right">Ïðèêðåïèòü ñêðèíøîò:</td>
<td><input name="screen" type="file" size="15" style="width: 300px;"></td>
</tr>
<tr>
<td align="right">Ñîîáùåíèå<span class="red">*</span>:</td>
<td><textarea rows="10" cols="40" name="message" class="inp" style="width: 300px;" wrap="hard"></textarea></td>
</tr>
<tr>
<td></td>
<td align="center"><label><input type="submit" name="submit" class="submit" value="Îòïðàâèòü" alt="Îòïðàâèòü" title="Îòïðàâèòü" style="width: 200px;"></label></td>
</tr>
<tr>
<td></td>
<td align="left"><span class="red">*</span> ïîëÿ, çàïîëíåíèå êîòîðûõ îáÿçàòåëüíî.</td>
</tr>
</table>
</form></p>
'; }
?>