Код PHP:
<?php
if (!empty($_POST['block_user'])) {
$usersToBlock = $_POST['chooseUser'];
foreach ($usersToBlock as $elem)
{
$db = mysqli_connect('localhost', 'root', '', 'registration');
mysqli_query($db,"UPDATE users SET Activity = 'Blocked' WHERE id ='$elem'");
header('location: login.php');
}
}
else
{
header('location: index.php');
}
if (!empty($_POST['unblock_user'])) {
$usersToBlock = $_POST['chooseUser'];
foreach ($usersToBlock as $elem)
{
echo $elem;
$db = mysqli_connect('localhost', 'root', '', 'registration');
mysqli_query($db,"UPDATE users SET Activity = 'Active ' WHERE id ='$elem'");
header('location: index.php');
}
}
else
{
header('location: index.php');
}