-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharchiveprocess.php
More file actions
28 lines (24 loc) · 929 Bytes
/
archiveprocess.php
File metadata and controls
28 lines (24 loc) · 929 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
<?php
if (isset($_POST['password']) && isset($_POST['id'])) {
include "../db_conn.php";
$password = mysqli_real_escape_string($conn, $_POST['password']);
$id = mysqli_real_escape_string($conn, $_POST['id']);
$sql = "SELECT * FROM users WHERE password = '$password' AND id = '$id'";
$result = mysqli_query($conn, $sql);
if (mysqli_num_rows($result) === 1) {
// Password is correct
if (isset($_POST['voicearchive'])) {
$voicearchive = mysqli_real_escape_string($conn, $_POST['voicearchive']);
$sql = mysqli_query($conn, "UPDATE button SET status = 4 WHERE id = '$voicearchive'");
if ($sql) {
echo 'approved';
} else {
echo 'error';
}
}
} else {
echo 'Invalid';
}
exit; // Exit to prevent executing the rest of the PHP script
}
?>