fix header redirect not working

This commit is contained in:
Zdenek Borovec 2024-06-29 08:13:16 +02:00
parent 0ce82e251d
commit cdf19a3b6d
4 changed files with 8 additions and 4 deletions

View file

@ -1,4 +1,3 @@
<!DOCTYPE html>
<?php
// Include config file
include_once("config.php");
@ -103,6 +102,7 @@ function display_header($pageTitle) {
$header_displayed = true;
printf("
<!DOCTYPE html>
<html lang=\"en\">
<head>
<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\">

View file

@ -400,11 +400,12 @@ if(isset($_POST["submit"])) {
// Try to send the comment
$commentId = send_comment($conn, $blogId, $posterId,
$commentContent, $parentId);
$commentContent, $parentId);
// Redirect to this page with GET
header("Location: http://www.zdenekborovec-dev.cz/blog/article?guid=".
header("Location: http://www.zdenekborovec-dev.cz/blog/article?blogpost_id=".
$blogId."#comment-".$commentId);
die();
}
// If no ID was entered, display warning and die.

View file

@ -82,7 +82,9 @@ function delete_user($conn, $confirmString) {
}
// Redirect to this page with GET
header(sprintf("Location: %s?success=true", sanitize_input($_SERVER["PHP_SELF"])));
header(sprintf("Location: %s?success=true",
sanitize_input($_SERVER["PHP_SELF"])));
die();
}
if (isset($_POST["submit"])) {

View file

@ -96,6 +96,7 @@ if (isset($_POST["submit"])) {
// If login succeeded, go to index
if($_SESSION["current_user"] != null) {
header("Location: "."http://www.zdenekborovec-dev.cz");
die();
}
}