¡Hola!
 
Tengo un archivo que adjunto en todas mis páginas llamado SiempreAdjunto.php , y que siempre me imprime un cierto HTML. Pues bien, tengo una página en la que se ejecuta una consulta MySQL y, con un header, vuelve a la página anterior. ¿Por qué me da el error que dejo debajo? Gracias 
Error 
Código:
 Warning: Cannot modify header information - headers already sent by (output started at /Applications/XAMPP/xamppfiles/htdocs/aprendamos/Plataforma/Cabecera/CabeceraRol3.php:63) in /Applications/XAMPP/xamppfiles/htdocs/aprendamos/Plataforma/Datos/CursosMaterias/Editar.php on line 19
  
Código PHP:
Ver original- <?php 
- // Me conecto a la base de datos con la variable $MyConnect 
- // También existe en las páginas y se deberá cambiar siempre que se deba en: 
-     // index.php (Página de login) 
-     // Acceder.php (tramitador del login) 
-         if ($_SERVER['HTTP_HOST'] == 'localhost'){ 
-             $MyConnect = new MySQLi('localhost','root','','aprendamos'); 
-         }else{ 
-             $MyConnect = new MySQLi('db612399625.db.1and1.com','dbo612399625','aprendamos','db612399625'); 
-         } 
- // Inicio la sesión siempre y por sistema en todas las páginas 
- // Si no existe un usuario de sesión nos iremos al inicio 
-     if (!isset($_SESSION['NombreUsuario'])){ 
-         if ($_SERVER['HTTP_HOST'] == 'localhost'){ 
-             header ("Location: http://localhost/aprendamos/index.php?Err=2"); 
-         }else{ 
-             header ("Location: http://".$_SERVER['HTTP_HOST']."/index.php?Err=2"); 
-         } 
-     } 
- // Compruebo si la página está en modo mantenimiento 
-     $QuerySP = "SELECT * FROM Status WHERE `Item` = 'ModoMantenimiento'"; 
-     $MyQuerySP = $MyConnect->query($QuerySP); 
-     $MyFetchSP = $MyQuerySP->fetch_assoc(); 
- // Si está en modo mantenimiento nos vamos fuera con mensaje de advertencia 
-     if ($MyFetchSP['Informacion'] === 'ON'){ 
-         if ($_SERVER['HTTP_HOST'] == 'localhost'){ 
-             header ("Location: http://localhost/aprendamos/index.php?Err=4"); 
-         }else{ 
-             header ("Location: http://".$_SERVER['HTTP_HOST']."/index.php?Err=4"); 
-         } 
-     } 
- // Como ya no puedo echar a nadie de ninguna forma más adjunto la cabecera, la cual variará en función del rol. 
-     if ($_SERVER['HTTP_HOST'] == 'localhost'){ 
-         include ($_SERVER['DOCUMENT_ROOT']."/aprendamos/Plataforma/Cabecera/CabeceraRol".$_SESSION['RolUsuario'].".php"); 
-     }else{ 
-         include ("http://".$_SERVER['HTTP_HOST']."/Plataforma/Cabecera/CabeceraRol".$_SESSION['RolUsuario'].".php"); 
-   
-     } 
Código PHP:
Ver original- <?php 
- // Requiero, y simplemente requiero, el 'siempre-adjunto' 
-     include_once ("../../../SiempreAdjunto.php"); 
- // Creo el query para guardar los cambios en el ID correspondiente 
-     $Query = " 
-     UPDATE 
-       `Asignaturas` 
-     SET 
-       `AsignaturaReducida` = '".$_GET['AsignaturaReducida']."', 
-       `Curso` = '".$_GET['Curso']."', 
-       `CursoReducido` = '".$_GET['CursoReducido']."', 
-       `Profesor` = '".$_GET['Profesor']."' 
-     WHERE 
-       `ID` = '".$_GET['ID']."' 
-     "; 
-     $MyQuery = $MyConnect->query($Query); 
- // Me voy a la página de inicio 
-     header ("Location: Inicio.php"); 
- ?>