first commit
This commit is contained in:
22
Web/imasBackend/getSetting.php
Normal file
22
Web/imasBackend/getSetting.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
include_once("db_config.php");
|
||||
date_default_timezone_set('Asia/Shanghai');
|
||||
header("Content-Type: application/json"); // 返回 JSON 格式的响应
|
||||
header("Access-Control-Allow-Origin: *"); // 允许跨域请求
|
||||
header("Access-Control-Allow-Methods: POST, OPTIONS"); // 允许的方法
|
||||
header("Access-Control-Allow-Headers: Content-Type"); // 允许的请求头
|
||||
|
||||
$queryString = "SELECT * FROM control_list";
|
||||
$result = mysqli_query($conn, $queryString);
|
||||
if(mysqli_error($conn)){
|
||||
echo json_encode(["code" => 1, "msg" => mysqli_error($conn)]);
|
||||
exit();
|
||||
}
|
||||
else{
|
||||
$data = array();
|
||||
while($row = mysqli_fetch_assoc($result)){
|
||||
$data[] = $row;
|
||||
}
|
||||
echo json_encode($data);
|
||||
}
|
||||
|
Reference in New Issue
Block a user