-
Notifications
You must be signed in to change notification settings - Fork 1
/
join_comm.php
74 lines (27 loc) · 999 Bytes
/
join_comm.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
<?php
//Load Composer's autoloader
require 'vendor/autoload.php';
include 'common.php';
$user_id=$_SESSION['id'];
$c_id=$_GET['id'];
$select_query1 = "SELECT name,email FROM users where id ='$user_id'";
$n = mysqli_query($con, $select_query1) or die(mysqli_error($con));
$row = mysqli_fetch_array($n);
$ns = $row['name'];
$subject="community joined";
$em = $row['email'];
$query="YOU HAVE SUCCESSFULLY JOINED THE COMMUNITY >>>>>>>> ENJOY AND START YOUR GREAT JOURNEY!!";
$select_query = "INSERT INTO user_communities (user_id, c_id, status) VALUES('$user_id', '$c_id', 'added to cart')";
mysqli_query($con,"UPDATE communities SET user_joined=user_joined+1 WHERE c_id='$c_id' LIMIT 1");
$select_query_result = mysqli_query($con, $select_query) or die(mysqli_error($con));
$message="
NAME:
$ns
email:
$em
Message:
$query
";
mail($em,$subject,$message);
header('location: communities.php?id='.$c_id.'');
?>