-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeletePartnerHeader.php
45 lines (40 loc) · 1.17 KB
/
deletePartnerHeader.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
42
43
44
45
<?php
require 'dbConnect.php';
$userID;
$email;
if(isset($_REQUEST['id']) &&
isset($_REQUEST['email']))
{
$userID = (int)$_REQUEST['id'];
$email = $_REQUEST['email'];
}
else
die("Stop trying to cheat");
$con = makeSQLI();
if($con === false)
die("ERROR CONNECTING TO DATABASE. Sorry...");
$count = 0;
$cleanID = $con->escape_string($userID);
$cleanEmail = $con->escape_string($email);
$sql = "DELETE from tb_partner_confirm WHERE fk_user_id = '$cleanID' AND partner_email_address = '$cleanEmail'";
if($result = $con->query($sql))
{
if($con->affected_rows == 1)
{
header("Status: 202 Accepted");
//mail("[email protected]", "User #".$userID." Deleted Partner: ".$email, "partner was unconfirmed.");
die("");
}
}
$sql = "DELETE from tb_partner_relation WHERE fk_user_id = '$cleanID' AND partner_email_address = '$cleanEmail'";
if($result = $con->query($sql))
{
header("Status: 202 Accepted");
//mail("[email protected]", "User #".$userID." Deleted Partner: ".$email, "partner was confirmed.");
die("");
}
else
header("Status: 409 Conflict");
//mail("[email protected]", "User #".$userID." Failed To Deleted Partner: ".$email, "Error: ".$con->error);
die("");
?>