intval($code), "message" => $message))); } function get_post($key, $is_error = true) { if (isset($_POST[$key])) return $_POST[$key]; else if ($is_error) error(400, "Missing parameters"); else return false; } function check_table_field($header, $table, $field) { $headers = apache_request_headers(); if (!isset($headers[$header])) return false; $u = database_exec("SELECT id FROM $table WHERE `$field` = :data", array(":data" => $headers[$header]))->fetch(); if (!$u) return false; return $headers[$header]; } ?>