set_charset ('utf8'); // スレのレス数を取得し,適切なレス番を設定する. if ($result = $mysqli -> query (" SELECT length FROM threads WHERE id = $thread")): $row = $result -> fetch_assoc (); $id = $row['length'] + 1; $result -> close (); // クヱリ結果を閉ぢる. endif; if ($_GET['held']): mb_language ('Japanese'); mb_internal_encoding ('UTF-8'); mb_send_mail ('matuda.miteruzo@gmail.com', 'キケッツ掲示板の画像確認しろ!', '何か,保留中なうみ.', '謎'); endif; // 投稿情報に従ひ,ディタ・ベィスを更新 $sql = "INSERT INTO responses (thread_id, response_id, name, pass, message, date, image, held, deleted) VALUES ($thread, $id, '" . (($_GET['name'] == '') ? '名なしさん' : $_GET['name']) . "', " . (($_GET['pass'] == '') ? "NULL" : "'{$_GET['pass']}'") . ", '', '" . date ('Y-m-d H:i:s') . "', '$file', {$_GET['held']}, 0)"; $mysqli -> query ($sql); $mysqli -> query (" UPDATE threads SET length = $id, latest = '" . date ('Y-m-d H:i:s') . "' WHERE id = $thread"); $mysqli -> close (); // ディタ・べィスを閉ぢる. unlink ('draft/' . $_COOKIE['backup']); setcookie ('backup', '', 0); /* * フェッチ内容から JSON パラメタを取得する. * * 戻り値は,取得した JSON パラメタ. */ function getParamJSON () { $buff = file_get_contents ('php://input'); $json = json_decode ($buff, true); return ($json); } /* * クヱリ送信者に,結果を返す. * $status:結果フラグ,$data:返信ディタ * * 戻り値は,なし. */ function sendResult ($status, $data) { header ('Access-Control-Allow-Origin: *'); header ('Access-Control-Allow-Headers: *'); echo json_encode(["status" => $status, "result" => $data]); }