-
Notifications
You must be signed in to change notification settings - Fork 2
/
block1.php
41 lines (37 loc) · 1.05 KB
/
block1.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
36
37
38
39
40
41
<html>
<body>
</br>
</br>
</br>
</br>
<form method="post" enctype="multipart/form-data">
<label for="name">User Name:</label>
<input type="text" name="un" placeholder="[email protected]" required>
<input type="submit" name="reg1" value="block"/>
<input type="submit" name="reg2" value="unblock"/>
</form>
</body>
</html>
<?php
if(isset($_POST['reg1']))
{
//echo "dfgbnjyu,";
$blk=$_POST['un'];
//echo $blk;
$con=mysqli_connect("localhost","root","","10am");
$sqlll= "UPDATE userinfo SET blkstatus=1 where user_name='$blk'";
//$check="update userinfo set blkstatus=1 where user_name='$blk'";
mysqli_query($con,$sqlll);
echo "<script>alert('BLOCKED');</script>";
}
if(isset($_POST['reg2']))
{
//echo "dfgbnjyu,";
$blk=$_POST['un'];
//echo $blk;
$con=mysqli_connect("localhost","root","","10am");
$sqlll= "UPDATE userinfo SET blkstatus=0 where user_name='$blk'";
//$check="update userinfo set blkstatus=1 where user_name='$blk'";
mysqli_query($con,$sqlll);
echo "<script>alert('UNBLOCKED');</script>";
}