-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathverify-purchase.php
More file actions
37 lines (29 loc) · 880 Bytes
/
Copy pathverify-purchase.php
File metadata and controls
37 lines (29 loc) · 880 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
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
session_start();
$paymentid = $_POST['paymentid'];
if (empty($_POST['paymentid']) || empty($_COOKIE['seller-email'])) {
header('location:seller-payments.php');
} else {
$email = $_COOKIE['seller-email'];
$servername = "localhost";
$username = "root";
$password = "PASSWORD";
$dbname = "fullcashback";
// Create connection
$conn = mysqli_connect($servername, $username, $password, $dbname);
// Check connection
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
echo "Connected successfully" . "<br>";
$sql = "UPDATE payments SET purchaseverified='true' WHERE id = '$paymentid'";
if (mysqli_query($conn, $sql)) {
echo "Record updated successfully" . "<br>";
} else {
echo "Error: " . $sql . "<br>" . mysqli_error($conn);
}
//Close the connection
mysqli_close($conn);
header('location:seller-payments.php');
}
?>