-
Notifications
You must be signed in to change notification settings - Fork 0
/
follow.php
31 lines (27 loc) · 915 Bytes
/
follow.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
<!-- follow or unfollow people form handler -->
<!DOCTYPE html>
<html lang="en">
<head>
<link href="fotoapp.css" rel="stylesheet">
<?php
require('db.php');
?>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Follow and unfollow form handler</title>
</head>
<body>
<?php
session_start();
$other = $_GET['name'];
$status = $_GET['status'];
if($status)
$sql = "DELETE FROM `followers` WHERE `User` like '".$_SESSION['username']."' and `Following` like '".$other."'";
else $sql = "INSERT INTO `followers`(`User`, `Following`) VALUES ('".$_SESSION['username']."','".$other."')";
$result = $conn->query($sql);
header("Location: ./otherspage.php?name=$other");
exit();
?>
</body>
</html>