Foros del Web » Programando para Internet » PHP »

Ayuda con el header

Estas en el tema de Ayuda con el header en el foro de PHP en Foros del Web. Hola a todos, tengo problemas con el error Cannot modify header information - headers already sent by. he leido en la web las distintas soluciones, ...
  #1 (permalink)  
Antiguo 08/09/2009, 15:28
HaX
 
Fecha de Ingreso: octubre-2007
Mensajes: 34
Antigüedad: 16 años, 5 meses
Puntos: 0
Ayuda con el header

Hola a todos, tengo problemas con el error Cannot modify header information - headers already sent by. he leido en la web las distintas soluciones, pero ninguna me funciona!
Bueno, tengo q crear un pdf a partir de una arreglo de datos, esto se ejecuta al precionar el boton exportar pdf. aca pego el codigo!!

ayuda pls!
Código PHP:
    function btn_genera_pdf(){

        
$arreglo_de_logs $this->so_logs->informe_logs();
        
        if(
$_POST['btn_exporta']){
               if(
$arreglo_de_logs != null){

            
$titles = array(
                
'id'=>'<b>Codigo</b>',
                
'accion'=>'<b>Accion</b>',
                
'url'=>'<b>Direccion</b>',
                
'fecha'=>'<b>Fecha</b>');
            
                       
$options = array(
                            
'shadeCol'=>array(0.9,0.9,0.9),
                            
'xOrientation'=>'center',
                            
'width'=>500
                        
);
            
$txttit "<b>Probando!!!</b>\n";
            
//$pdf->ezImage('pato.jpeg', 0,100, 'none');

            
$this->pdf->ezStartPageNumbers(300,20,15,'','',1);
            
//$this->pdf->addJpegFromFile("pato.jpeg",50,760,100);

            
$this->pdf->ezText("\n\n\n"5);
            
$this->pdf->ezText($txttit18, array('justification' => 'centre'));
            
$this->pdf->ezText("\n\n\n"5);
            
$this->pdf->addText(330,800,10,"Fecha: ".date("d/m/Y"));
            
$this->pdf->addText(480,800,10,"-".date("H:i")."\n\n");
            
//$pdf->setLineStyle(1);

            //$pdf->line(50,720,550,720);

            
$this->pdf->ezTable($logs$titles,'ejemplo'$options);
            
$this->pdf->ezText("\n\n\n"10);
            
$this->pdf->ezStream();
             }
       }

las solcuiones que he intentado son, sacar espacion, caracteres, raros, etc. tambien con el ob_start, ademas con session_start(), pero no resulta nada, eso si q lo leido todos dice q la solucione seria el header, pero tampoco me funciona :(

pd: sorry por la tabulacion de las llaves :(

ayuda pls!
  #2 (permalink)  
Antiguo 08/09/2009, 16:24
Avatar de GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 17 años, 10 meses
Puntos: 2135
Respuesta: Ayuda con el header

Lee lo siguiente:

http://www.forosdelweb.com/wiki/PHP:...lready_sent%3F

http://www.forosdelweb.com/wiki/PHP:...n_line_4%22%3F

Saludos.
  #3 (permalink)  
Antiguo 09/09/2009, 14:50
HaX
 
Fecha de Ingreso: octubre-2007
Mensajes: 34
Antigüedad: 16 años, 5 meses
Puntos: 0
Respuesta: Ayuda con el header

GRAX por la ayuda, pero no me resulta.

quien me puede ayudar pls!!!
  #4 (permalink)  
Antiguo 09/09/2009, 23:01
Avatar de GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 17 años, 10 meses
Puntos: 2135
Respuesta: Ayuda con el header

Es sencillo el mismo error te dice en que linea empieza el output de texto, ve a esa linea y elimina ese output de texto.

Saludos.
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 19:29.