Warning: Cannot modify header information - headers already sent by (output started at
lo mas raro es que cuando añado el codigo en la pagina sin el include no me marca ese error, eh cuidado los saltos de linea y no hacer echos antes del header pero sigue el error.
Este es mi codigo:
Código PHP:
<?php
session_start();
include("db/conexion.php");
$sesion = $_SESSION['sesion'];
if ($sesion!="1")
header("Location:http://www.enchiwas.com/index.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>W</title>
<link rel="stylesheet" type="text/css" href="css.css" />
</head>
<body>
<div align="center"><img src="imagenes/logo.jpg" alt="Enchiwas.com" width="500" height="100" /><br />
<a href="logout.php">CERRAR SESION</a></div>
</body>
</html>
Código PHP:
<?php $link = mysql_connect("localhost","user","pass");
mysql_select_db("db"); ?>