-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgo.php
41 lines (35 loc) · 897 Bytes
/
go.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
<?php ob_start(); ?>
<?php
session_start();
$user_id = $_SESSION['user_id'];
?>
<?php
if(!$user_id){
header("location: index.php");
exit;
}
?>
<?php
$follow_userid = $_GET['tribe'];
$name = $_GET['name'];
include 'connect.php';
$chi = "SELECT user_id
FROM tribemems
WHERE user_id='$user_id' AND tribe_id='$follow_userid'
";
$query2=mysqli_query($conn, $chi);
mysqli_close($conn);
if(mysqli_num_rows($query2)>=1){
include 'connect.php';
$yiq="DELETE FROM tribemems WHERE user_id='$user_id' AND tribe_id='$follow_userid'
";
$com=mysqli_query($conn, $yiq);
$yi="UPDATE tribes
SET members = members - 1
WHERE id='$follow_userid'
";
$comx=mysqli_query($conn, $yi);
mysqli_close($conn);
}
header("Location: tribe.php?tribe=$follow_userid&name=$name");
?><?php ob_end_flush();?>