-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsave.php
More file actions
38 lines (31 loc) · 697 Bytes
/
save.php
File metadata and controls
38 lines (31 loc) · 697 Bytes
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
<?php
$http_code = array(
200 => "HTTP/1.0 200 OK"
, 400 => "HTTP/1.0 400 Bad Request"
);
$http_header = $http_code[400];
$o = 'error:no tableId';
if (isset($_REQUEST['tableId']))
{
$tableId = $_REQUEST['tableId'];
if (isset($_REQUEST['field']))
{
// one field/value pair
$rowId = $_REQUEST['rowId'];
$field = $_REQUEST['field'];
$value = $_REQUEST['value'];
if ($field == 'task' && ! preg_match('/^[a-zA-Z0-9 ]+$/', $value))
$o = "error:`task` format mismatched";
else {
$o = "ok:tableId $tableId, rowId $rowId, field $field, value $value\n";
$http_header = $http_code[200];
}
}
else
{
$o = 'error:no field';
}
}
// header($http_header);
print $o;
exit;