0

I have moved my project from XAMPP to docker container and somehow my header() don't work anymore.

    if (isset($_SESSION['username'])) {
  if ($_SESSION['username'] == "oszi") {
    header("Location: ./sites/adminAccount.php");
  } else {
    header("Location: ./sites/account.php");
  }
}

this part of my code checks for the usesrname in sessions. it works and want's redirect me to site/adminAccount.php but then gives me an error:

Warning: Cannot modify header information - headers already sent by

it worked fine with XAMPP but doesn't work with docker

  • What have you tried to resolve the problem? Where are you stuck? – Nico Haase Jan 11 '22 at 11:54
  • 3
    Read the rest of the error message to find out the location where output is being sent. Most likely, the error has always been there but now you've either enabled stricter error reporting directives or you've disabled output buffering. – Álvaro González Jan 11 '22 at 11:56

0 Answers0