Answer the question
In order to leave comments, you need to log in
Error when redirecting to another page?
Error when logging in
Warning: Cannot modify header information - headers already sent by (output started at C:\OpenServer\domains\localhost\login.php:2) in C:\OpenServer\domains\localhost\login.php on line 29
header('Location: /');
exit();
Answer the question
In order to leave comments, you need to log in
If you want to work with headers, then you cannot place bare html with php code inclusions, the log will be clogged with warnings.
When executing a php file at the beginning, it should be silent like a fish, if the logic of work provides for a choice - work first with headers, and then display content, or simply output content (via print, echo, etc.).
That is, headers must fire first, any echo between header() will break the order.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question