-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcreate_config.php
40 lines (35 loc) · 1.1 KB
/
create_config.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
<?php
/*
第一修改者为作者
修改者:半条咸鱼,lbr-dev,预留
修改者GITHUB:半条咸鱼(https://github.com/Halfsaltedfish/),lbr-dev(https://github.com/lbr-dev/),预留
修改者QQ:半条咸鱼(379369845),lbr-dev(3170482764),预留
本项目开源地址:https://github.com/kingcardconfig/kingcardconfig/
*/
include_once('public.php');
$config = file_get_contents('php://input');
// check for required fields
if (strlen($config) > 50) {
$result = file_put_contents($configwkdtconfigfilename,$config);
// check result
if ($result>50) {
// successfully put into file
$response["success"] = 1;
$response["message"] = "Config successfully created.";
// echoing JSON response
echo json_encode($response);
} else {
// failed to insert row
$response["success"] = 0;
$response["message"] = "put failed";
// echoing JSON response
echo json_encode($response);
}
} else {
// required field is missing
$response["success"] = 0;
$response["message"] = "Required field(s) is missing";
// echoing JSON response
echo json_encode($response);
}
?>