-
Notifications
You must be signed in to change notification settings - Fork 0
/
favorilereekle.php
39 lines (32 loc) · 1.11 KB
/
favorilereekle.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
<?php
if (isset($_SESSION["Kullanici"])) {
if (isset($_GET["ID"])) {
$GelenID = Guvenlik($_GET["ID"]);
} else {
$GelenID = "";
}
if ($GelenID != "") {
$FavoriKontrolSorgusu = $VeritabaniBaglantisi->prepare("SELECT * FROM favoriler WHERE UrunId = ? AND UyeId = ? LIMIT 1");
$FavoriKontrolSorgusu->execute([$GelenID, $KullaniciID]);
$FavoriKontrolSayisi = $FavoriKontrolSorgusu->rowCount();
if ($FavoriKontrolSayisi > 0) {
header("Location:index.php?SK=90");
exit();
} else {
$FaforiEklemeSorgusu = $VeritabaniBaglantisi->prepare("INSERT INTO favoriler (UrunId, UyeId) values (?, ?)");
$FaforiEklemeSorgusu->execute([$GelenID, $KullaniciID]);
$FaforiEklemeSayisi = $FaforiEklemeSorgusu->rowCount();
if ($FaforiEklemeSayisi > 0) {
header("Location:index.php?SK=88");
exit();
} else {
header("Location:index.php?SK=89");
exit();
}
}
}
} else {
header("Location:index.php");
exit();
}
?>