-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaccept.php
executable file
·35 lines (29 loc) · 1010 Bytes
/
accept.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
<?php
include('functions.php');
$id = $_GET['id'];
$query = "SELECT * FROM `users` WHERE `id` = '$id';";
if(count(fetchAll($query)) > 0){
foreach(fetchAll($query) as $row){
$username = $row['username'];
$mpesa = $row['mpesa'];
$amount = $row['amount'];
$hashed_password = $row['password'];
$date = $row['date'];
$query = "INSERT INTO `accounts` (`id`, `username`, `type`, `mpesa`, `amount`, `password`, `date`) VALUES (NULL, '$username', 'user', '$mpesa', '$amount', '$hashed_password', '$date');";
}
if(performQuery($query)){
echo "Account Approval Was Successful";
}else{
echo "An error has occured";
}
$query = "DELETE FROM `users` WHERE `users`.`id` = '$id';";
if(performQuery($query)){
echo "Account Approval Was Successful";
}else{
echo "An error has occured";
}
}else{
echo "An Error Occured";
}
?>
<a href="index.php">Back</a>