-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdelete2.php
35 lines (29 loc) · 859 Bytes
/
delete2.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
<meta http-equiv="refresh" content="1;url=index.php" charset="utf-8"/>
<?php
$id = $_GET['id'];
//echo $id;
if(is_numeric($id)) { ////判断id是否为数字
$data = '{"ID":' . $id . '}';
$url = 'http://218.192.166.167/api/protype.php';
$post_data = array(
'table' => 'pickItems',
'method' => "delete",
'data' => $data,
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
$return = curl_exec($ch);
curl_close($ch);
$array = json_decode($return, true);
if ($array['status'] == 1) {
echo '删除成功';
} else {
echo '删除失败';
}
}else{
echo "删除失败";
}