-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathunfollow.php
More file actions
24 lines (22 loc) · 796 Bytes
/
Copy pathunfollow.php
File metadata and controls
24 lines (22 loc) · 796 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
session_start();
require_once ('include/header.php');
require_once ('include/dbconfig.php');
require_once ('include/helpfulFunctions.php');
$username = $_SESSION['username'];
$followee = $_GET['followee'];
$pdo = db_connect();
$stmt = $pdo -> prepare(
"delete from UserFollow
where username = :username and followee = :followee");
$stmt -> bindParam(":username", $username, $pdo::PARAM_STR);
$stmt -> bindParam(":followee", $followee, $pdo::PARAM_STR);
$result = $stmt -> execute();
if (isset($result)) {
correctMessage("Unfollowed the person!");
echo "<meta http-equiv='refresh' content='0; url=user.php?username=$followee'>";
} else {
warningMessage("Cannot unfollow the person");
}
require_once ('include/footer.html');
?>