-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreject.php
35 lines (28 loc) · 1.15 KB
/
reject.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
require 'loginsystem/partials/dbconnect.php';
$id = $_GET['id'];
$query = "select * from `requests` where `id` = '$id' ";
$result=mysqli_query($con,$query);
$num=mysqli_num_rows($result);
if($num > 0){
while(($fetch=mysqli_fetch_assoc($result))){
$firstname = $fetch['firstname'];
$lastname = $fetch['lastname'];
$username = $fetch['username'];
$password = $fetch['password'];
$pack=$fetch['pack'];
$email=$fetch['email'];
$q= "INSERT INTO `rejected` (`firstname`, `lastname`, `username`, `password`, `pack`, `email`) VALUES ('$firstname', '$lastname', '$username', '$password', '$pack', '$email');";
$r=mysqli_query($con,$q);
}
}
$query = "DELETE FROM `requests` WHERE `requests`.`id` = '$id'";
$result=mysqli_query($con,$query);
if($result){
echo "Account has been rejected.";
}else{
echo "Unknown error occured. Please try again.";
}
// header("location:home.php");
echo "<script>window.location.href='home.php'</script>";
?>