From 00833eeafd6e0f71390504ac10ddf86bbaceb39f Mon Sep 17 00:00:00 2001 From: Michael Foster Date: Sun, 15 Sep 2013 14:03:27 +1000 Subject: js/ajax.js: post with ajax --- post.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'post.php') diff --git a/post.php b/post.php index 1fe3b35f..0bc26f46 100644 --- a/post.php +++ b/post.php @@ -743,7 +743,15 @@ if (isset($_POST['delete'])) { else rebuildThemes('post', $board['uri']); - header('Location: ' . $redirect, true, $config['redirect_http']); + if (!isset($_POST['json_response'])) { + header('Location: ' . $redirect, true, $config['redirect_http']); + } else { + header('Content-Type: text/json; charset=utf-8'); + echo json_encode(array( + 'redirect' => $redirect, + 'id' => $id + )); + } } else { if (!file_exists($config['has_installed'])) { header('Location: install.php', true, $config['redirect_http']); -- cgit v1.3