-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblocked.php
34 lines (34 loc) · 1.06 KB
/
blocked.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
<?php
include ("config.php");
include ("bd.php");
if (isset($_SESSION['id']))
{
$id = $_SESSION['id'];
}
if (!empty($_SESSION['email']) and !empty($_SESSION['password']))
{
$email = $_SESSION['email'];
$password = $_SESSION['password'];
$result2 = mysql_query("SELECT * FROM user WHERE email_user='$email' AND pass_user='$password'",$db);
$myrow2 = mysql_fetch_array($result2);
if (empty($myrow2['id_user']))
{
exit("Вход на эту страницу разрешен только зарегистрированным пользователям!1");
}
}
else
{
var_dump($_SESSION['password']);
exit("Вход на эту страницу разрешен только зарегистрированным пользователям!2");
}
$id_blocked = $_GET['id'];
$result = mysql_query("UPDATE user SET block_user='1' WHERE id_user='$id_blocked'",$db);
if($result=='TRUE')
{
header('Location: http://localhost/page_users.php?id='.$id_blocked.'');
}
else
{
echo $id_blocked;
}
?>