Ver Mensaje Individual
  #1 (permalink)  
Antiguo 25/01/2010, 07:38
arathorng
 
Fecha de Ingreso: enero-2010
Mensajes: 6
Antigüedad: 14 años, 3 meses
Puntos: 0
Warning: Cannot modify header information - headers already sent by (output started a

que tal, tengo un error en mi pagina web, cuando la ejecuto local no tengo problemas, pero cuando la subo al servidor Cpanel, me da el siguiente error:

Warning: Cannot modify header information - headers already sent by (output started at /home/futuro/public_html/archivosexcel.php:4) in /home/futuro/public_html/archivosexcel.php on line 87

Warning: Cannot modify header information - headers already sent by (output started at /home/futuro/public_html/archivosexcel.php:4) in /home/futuro/public_html/archivosexcel.php on line 88

Warning: Cannot modify header information - headers already sent by (output started at /home/futuro/public_html/archivosexcel.php:4) in /home/futuro/public_html/archivosexcel.php on line 89

Warning: Cannot modify header information - headers already sent by (output started at /home/futuro/public_html/archivosexcel.php:4) in /home/futuro/public_html/archivosexcel.php on line 90


estoy mandando los datos de la pagina a un excel, con el siguiente codigo:

<?php include "conexion.php";
$cod = $_GET['type'];
if($cod == 1){
echo '<table width="754" border="1">';
echo '<tr>';
echo '<td width="43">Folio</td>';
echo '<td width="120">Id Proyecto </td>';
echo '<td width="140">Titulo de Evento </td>';
echo '<td width="101">Detalle de Evento </td>';
echo '<td width="101">Fecha de Inicio </td>';
echo '<td width="101">Fecha de Termino </td>';
echo '<td width="102">Fecha de Creaci&oacute;n </td>';
echo '</tr>';
$listar = "SELECT * FROM bp_agendas";
$ejecutarlistar = mysql_query($listar,$con);
while($rs = mysql_fetch_array($ejecutarlistar,$seleccion_bd)){
echo'<tr>';
echo'<td>'. $rs['id_agenda'].'</td>';
echo'<td>'. $rs['idproy_agenda'].'</td>';
echo'<td>'. $rs['titulo_agenda'].'</td>';
echo'<td>'. $rs['detalle_agenda'].'</td>';
echo'<td>'. $rs['fechai_agenda'].'</td>';
echo'<td>'. $rs['fechat_agenda'].'</td>';
echo'<td>'. $rs['fechac_agenda'].'</td>';
echo'</tr>';
}
echo'</table>';

$file_type="vnd.ms-excel";
$file_name="Tabla_bp_agendas";
$file_ending="xls";

header("Content-type: application/$file_type");
header("Content-disposition: attachment; filename=$file_name.$file_ending");
header("Pragma: no-cache");
header("Expires: 0");
}
?>

Bueno, el codigo es mas extenso, pero se repite para 6 casos, por lo uqe se, es algo de que no puedo modificar las cabeceras o algo asi, porfavor ayuda.

Gracis