-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathvpass.php
34 lines (30 loc) · 943 Bytes
/
vpass.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
header("Access-Control-Allow-Origin: *");
header("Content-Type: application/json");
header("Access-Control-Allow-Methods: GET");
header("Access-Control-Allow-Headers: Access-Control-Allow-Headers, Content-Type, Access-Control-Allow-Methods, Authorization, X-Requested-With");
include '../private/connect.php';
$db = Database::getInstance();
$c = $db->getc();
if(isset($_GET['id'])) {
$id = $_GET['id'];
$sql = $c->query("SELECT * FROM ptemp WHERE request_id='$id'");
if($sql->num_rows == 0) {
$msg = array('password' => NULL);
printf(json_encode($msg));
}else {
$exe = $sql->fetch_array();
if($exe['verify'] == NULL) {
$msg = array('password' => NULL);
printf(json_encode($msg));
}
elseif ($exe['verify'] == 'valid') {
$msg = array('password' => true);
printf(json_encode($msg));
} else {
$msg = array('password' => false);
printf(json_encode($msg));
}
}
}
?>