-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaddevents.php
83 lines (44 loc) · 937 Bytes
/
addevents.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
<?php
include('.\includes\config.php');
$id=$_GET['id'];
$sq1="update events set validate ='1' where e_id='$id'";
$r=mysqli_query($con,$sq1);
$sq= "SELECT * FROM `events` WHERE e_id='$id'";
echo $sq;
$res = mysqli_query($con,$sq);
$ca="";
while($row=mysqli_fetch_assoc($res))
{
$ca= $row['cat'];
}
echo $ca;
$sql= "SELECT * FROM parti_reg WHERE int_cat LIKE '%$ca%'";
echo $sql."<br/>";
$res= mysqli_query($con,$sql);
$cnt = mysqli_num_rows($res);
$to="";
while($row=mysqli_fetch_assoc($res))
{
$to=$row['email'];
$subject = "My subject";
$message= "Hello world!";
$headers = "From: activityclash@gmail.com";
echo $to."<br/>";
$t = mail($to,$subject,$message,$headers);
if($t)
{
echo"Mail sent successfully";
}
else{
echo"error";
}
}
if(mysqli_query($con,$sql))
{
header('Location:htmlevent.php');
}
else{
echo " false". mysqli_error($con);
}
mysqli_close($con);
?>