Ver Mensaje Individual
  #1 (permalink)  
Antiguo 07/12/2011, 02:24
TheCastor
 
Fecha de Ingreso: junio-2011
Mensajes: 68
Antigüedad: 13 años, 7 meses
Puntos: 4
Warning con Header

Tengo un problema... al añadir un header ("Location: ...") para que me redireccione a otro archivo me sale un warning.
Este warning no me a salido nunca, y he probado varias cosas.
Os dejo el codigo y el warning a continuacion:

CODIGO

Código:
<?php
	require_once ('../conexion/poligono_connect.php');
	include("header.php");
	
	$msg=0;
	
	echo 'usuario = ' . $_POST['usuario'] . '<br>';
	
	if($_POST['enviar']){
			if (($_POST['usuario']!= '') && ($_POST['contrasena']!='')){
				
				$sql="select count(*) as contador from usuario where usuario= '" . $_POST['usuario'] . "' and contrasena= '" . $_POST['contrasena'] . "'";
				$resultado=mysql_query($sql) or die( "$sql: " . mysql_error() );
				$row=mysql_fetch_array($resultado);
			
			
				if($row['contador']!= 0){
					$_SESSION['usuario']=$_POST['usuario'];
					//header("Location: control/index.php");	
					header ("Location: index.php"); /* Si ha iniciado la sesion, vamos a user.php */

				}else{
					$msg=1;
				}
			}else{
				$msg=1;
			}
	}
?>
WARNING

Warning: Cannot modify header information - headers already sent by (output started at /Applications/XAMPP/xamppfiles/htdocs/webalizer/PlanosPoligonos/WebV2/control/login.php:9) in /Applications/XAMPP/xamppfiles/htdocs/webalizer/PlanosPoligonos/WebV2/control/login.php on line 28