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

View file

@ -403,8 +403,9 @@ if(isset($_POST["submit"])) {
$commentContent, $parentId); $commentContent, $parentId);
// Redirect to this page with GET // 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); $blogId."#comment-".$commentId);
die();
} }
// If no ID was entered, display warning and 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 // 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"])) { if (isset($_POST["submit"])) {

View file

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