From 33a304cedc590f024266f3cf7842d391cca946b4 Mon Sep 17 00:00:00 2001 From: Jonas Leder Date: Tue, 9 Nov 2021 12:28:04 +0100 Subject: [PATCH] fix redirect after comment publish --- public/API/newComment.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/API/newComment.php b/public/API/newComment.php index 1d63270..ab8d298 100644 --- a/public/API/newComment.php +++ b/public/API/newComment.php @@ -30,7 +30,7 @@ if($responseData->success) { $sql = "INSERT INTO comments (name, email, comment, article) VALUES ('$name', '$email', '$comment', '$article')"; if ($conn->query($sql) === TRUE) { - header("Location: $ref"); + header("Location: " . $_SERVER["HTTP_REFERER"]); } else { echo "Error: " . $sql . "
" . $conn->error; }