I
I
Igor Unknown2015-12-29 18:01:05
PHP
Igor Unknown, 2015-12-29 18:01:05

How to fix error in Header?

Hello, I made an authorization system, but after the cookie is activated to redirect the user, it displays the following ...

Warning: Cannot modify header information - headers already sent by (output started at P:\home\test1.ru\subdomain\logins.php:5) in P:\home\test1.ru\subdomain\logins.php on line 12

Line 12 itself
if(isset($_SESSION["session_username"])){
header("location:glav.php");
}

I didn't find any spaces between <?php.
ANSI encoding (UTF-8 without BOOM did not help)

Line 5 and above
<?php require_once("includes/connection.php"); ?>
<?php
session_start();
?>
<?php require_once("includes/connection.php"); ?>
<?php include("includes/header.php"); ?>
<?php

Answer the question

In order to leave comments, you need to log in

4 answer(s)
I
Igor Neizvestny, 2015-12-29
@JB_Defalt

I found an error, the problem was that the footer was sending the header, I deleted it and everything was fine.

V
Villarou, 2015-12-29
@VirmarY

This message indicates that you have already received a title from another location. And specifically, from the logins.php file, line 5. What do you have in it?
Check out the future . I think it will be useful. At the same time, you will understand what Rishat Kadyrov wrote to you about.

S
Sergey Nalomenko, 2015-12-29
@nalomenko

So it is written: the error occurred on line 12, and earlier information about the headers was sent on line 5 of the logins.php file. Look there.

R
Rishat Kadyrov, 2015-12-29
@laska

This or another file has already sent headers.
Line 12 is not to blame for anything, look for the error above.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question