-
Notifications
You must be signed in to change notification settings - Fork 0
/
remuser.php
35 lines (30 loc) · 901 Bytes
/
remuser.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
//Establish connection information
$servername = "localhost";
$username = "id5026401_root";
$password = "12345678";
$dbname = "id5026401_test";
$usernamerem = $_POST["remusername"];
//Establish connection
$connection = new mysqli($servername, $username, $password, $dbname);
if ($usernamerem != '') {
$insertreqest = "DELETE FROM review WHERE username='$usernamerem'";
if (mysqli_query($connection, $insertreqest)) {
sleep(1);
header("location: {$_SERVER['HTTP_REFERER']}");
// exit;
}
else {
echo "Error: " . $insertreqest . "<br>" . mysqli_error($connection);
}
$insertreqest2 = "DELETE FROM users WHERE username='$usernamerem'";
if (mysqli_query($connection, $insertreqest2)) {
sleep(1);
header("location: {$_SERVER['HTTP_REFERER']}");
exit;
}
else {
echo "Error: " . $insertreqest2 . "<br>" . mysqli_error($connection);
}
}
?>