|
@@ -18,16 +18,26 @@ function error($code, $message)
|
18
|
18
|
die(json_encode(array("code" => intval($code), "message" => $message)));
|
19
|
19
|
}
|
20
|
20
|
|
21
|
|
-function get_post($key, $is_error = true)
|
|
21
|
+function get_param($array, $key, $is_error)
|
22
|
22
|
{
|
23
|
|
- if (isset($_POST[$key]))
|
24
|
|
- return $_POST[$key];
|
|
23
|
+ if (isset($array[$key]))
|
|
24
|
+ return $array[$key];
|
25
|
25
|
else if ($is_error)
|
26
|
26
|
error(400, "Missing parameters");
|
27
|
27
|
else
|
28
|
28
|
return false;
|
29
|
29
|
}
|
30
|
30
|
|
|
31
|
+function get_post($key, $is_error = true)
|
|
32
|
+{
|
|
33
|
+ get_param($_POST, $key, $is_error);
|
|
34
|
+}
|
|
35
|
+
|
|
36
|
+function get_get($key, $is_error = true)
|
|
37
|
+{
|
|
38
|
+ get_param($_GET, $key, $is_error);
|
|
39
|
+}
|
|
40
|
+
|
31
|
41
|
function check_table_field($header, $table, $field)
|
32
|
42
|
{
|
33
|
43
|
$headers = apache_request_headers();
|