-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathget.php
52 lines (42 loc) · 1.14 KB
/
get.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
42
43
44
45
46
47
48
49
50
51
52
<?php
header("Content-Type:application/json;charset=UTF-8");
$code = $_GET['code'];
$poc = array(
"poc_1" => 1,
"poc_2" => 2,
"poc_3" => 3,
"poc_4" => 4,
"poc_5" => 5,
"poc_6" => 6,
"poc_7" => 7,
"poc_8" => 8,
"poc_9" => 9,
"poc_10" => 10
);
//参数 code验证
if(strpos($code, "||") == false){
echo json_encode(array("status" => false, "msg" => "error code!"));
exit();
}
list($key, $value) = explode("||", $code);
if ($value != strtoupper(substr(md5("hongcha". $key ."android"),1,-1)) ){
echo json_encode(array("status" => false, "msg" => "error code!"));
exit();
}
$mysql = new SaeMysql();
$sql = "select * from result where code ='" . $mysql->escape($code) . "'";
$data = $mysql->getData($sql);
$result = array();
if($data){
$tmpdata = $data[0];
foreach($tmpdata as $key => $value){
if($key != "code" && $key != "id" && $key != "token" && $key != "ua"){
$result[$key] = intval($value);
}
}
echo json_encode(array("status" => true, "msg" => $result));
}else{
echo json_encode(array("status" => false, "msg" => "query empty!"));
}
$mysql->closeDb();
?>