-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwait.php
More file actions
51 lines (38 loc) · 979 Bytes
/
Copy pathwait.php
File metadata and controls
51 lines (38 loc) · 979 Bytes
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
42
43
44
45
46
47
48
49
50
51
<?php
require_once 'include/DB_Functions.php';
$db = new DB_Functions();
$con = $db->conn;
$response = array();
if (isset($_POST['id'])) {
$id = $_POST['id'];
$sql = "SELECT certification FROM users where id = '$id'";
$result = mysqli_query($con, $sql);
$row = mysqli_fetch_array($result);
//echo $row['certification'];
if ($row['certification'] == 1) {
$response["success"] = true;
echo json_encode($response);
$sql2 = "update users set students_pic = 'null' where id = '$id'";
$result2 = mysqli_query($con, $sql2);
}
else if($row['certification'] == 2) {
$response["success"] = false;
echo json_encode($response);
}
}
?>
<?php
$android = strpos($_SERVER['HTTP_USER_AGENT'], "Android");
if (!$android){
?>
<html>
<body>
<form action="<?php $_PHP_SELF ?>" method="POST">
ID: <input type = "text" name = "id" />
<input type = "submit" />
</form>
</body>
</html>
<?php
}
?>