From 130efdf467ed59670f108924199a42a33a26b5d2 Mon Sep 17 00:00:00 2001 From: Savetheinternet Date: Thu, 16 Dec 2010 19:13:04 +1100 Subject: [PATCH] Redirect to referer --- mod.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mod.php b/mod.php index b44f502f..ddd58ab4 100644 --- a/mod.php +++ b/mod.php @@ -194,8 +194,13 @@ deletePost($post); // Rebuild board buildIndex(); - // Redirect to board - header('Location: ?/' . sprintf(BOARD_PATH, $boardName) . FILE_INDEX, true, REDIRECT_HTTP); + + // Redirect + if(isset($_SERVER['HTTP_REFERER'])) + header('Location: ' . $_SERVER['HTTP_REFERER'], true, REDIRECT_HTTP); + else + header('Location: ?/' . sprintf(BOARD_PATH, $boardName) . FILE_INDEX, true, REDIRECT_HTTP); + } else { error("Page not found."); }