-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsos_system.php
52 lines (40 loc) · 1.45 KB
/
sos_system.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
<?php
include 'dbh.php';
ini_set('max_execution_time', 300); //setting the maximum execution time for mail sending
if(isset($_POST['id']))
{
$userId=mysqli_real_escape_string($conn,$_POST['id']);
$sql="SELECT e_email_1,e_email_2,name FROM memberstable WHERE id='$userId'";
$result=mysqli_query($conn,$sql);
while($row=mysqli_fetch_assoc($result))
{
$name=$row['name'];
//email 1
$to = $row['e_email_1'];
$subject = $name.' is in danger!';
$message = '<html>
<body>
'.$name.' has just pressed the EMERGENCY button! Please respond immediately! Or they will die, yo!
</body>
</html>';
'Reply-To: [email protected]' . "\r\n" .
'X-Mailer: PHP/' . phpversion()."\r\n";
$headers.="Content-Type: text/html; charset=ISO-8859-1\r\n";
mail($to, $subject, $message, $headers);
//email 2
$to = $row['e_email_2'];
$subject = $name.' is in danger!';
$message = '<html>
<body>
'.$name.' has just pressed the EMERGENCY button! Please respond immediately! Or they will die, yo!
</body>
</html>';
'Reply-To: [email protected]' . "\r\n" .
'X-Mailer: PHP/' . phpversion()."\r\n";
$headers.="Content-Type: text/html; charset=ISO-8859-1\r\n";
mail($to, $subject, $message, $headers);
}
echo 'success';
}