Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Galera, estou tentando exportar a tabela uma cara e não consigo, segue meu código abaixo e o erro que é apresentado.
[ TABELA ]
require"conexao_bd.php";
$query = "SELECT * FROM usuarios_planta order by id_uplanta desc";
$executar_query = mysql_query($query);
$contar = mysql_num_rows($executar_query);
for($i=0;$i<1;$i++){
$html[$i] = "";
$html[$i] .= '';
$html[$i] .= '<table cellpadding="0" cellspacing="0" border="1">';
$html[$i] .= '<thead>';
$html[$i] .= '<tr>';
$html[$i] .= "<th colspan=\"6\" style=\"font-size:18px; font-weight:bold; color:#069; height:40px;\">TABELA USUÁRIOS CADASTRADOS - MAR DE OFFERTAS</th>";
$html[$i] .= '</tr>';
$html[$i] .= '<tr style="font-size:14px; font-weight:bold;">';
$html[$i] .= '<th width="100">COD</th>';
$html[$i] .= '<th width="100">Senha</th>';
$html[$i] .= '<th width="100">E-mail</th>';
$html[$i] .= '<th width="110">Nome</th>';
$html[$i] .= '<th width="110">Confirmação de senha</th>';
$html[$i] .= '<th width="190">Sobrenome</th>';
$html[$i] .= '<th width="190">Data de Aniversário</th>';
$html[$i] .= '<th width="190">CPF</th>';
$html[$i] .= '<th width="190">Data do cadastro</th>';
$html[$i] .= '<th width="190">Hora do cadastro</th>';
$html[$i] .= '</tr>';
$html[$i] .= '</thead>';
$html[$i] .= '<tbody>';
}
$i = 1;
while($f_lista = mysql_fetch_array($executar_query)){
if($i % 2){
$color = '#F4F4F4';
} else
{
$color = '#FFFFFF';
}
$html[$i] .= "<tr align=\"center\">";
$html[$i] .= "<td bgcolor=\"".$color."\" width=\"32\" style=\"padding-left:3px; text-align:center; font-weight:bold; font-size:14px;\">".$f_lista['id_usuario']."</td>";
$html[$i] .= "<td bgcolor=\"".$color."\" width=\"100\" style=\"text-align:left; padding-left:6px;\">".$f_lista['senha']."</td>";
$html[$i] .= "<td bgcolor=\"".$color."\" width=\"110\">".$f_lista['email']."</td>";
$html[$i] .= "<td bgcolor=\"".$color."\" width=\"110\">".$f_lista['nome']."</td>";
$html[$i] .= "<td bgcolor=\"".$color."\" width=\"110\">".$f_lista['senha2']."</td>";
$html[$i] .= "<td bgcolor=\"".$color."\" width=\"110\">".$f_lista['sobrenome']."</td>";
$html[$i] .= "<td bgcolor=\"".$color."\" width=\"110\">".$f_lista['aniversario']."</td>";
$html[$i] .= "<td bgcolor=\"".$color."\" width=\"110\">".$f_lista['cpf']."</td>" ;
$html[$i] .= "<td bgcolor=\"".$color."\" width=\"110\">".$f_lista['data_cadastro']."</td>";
$html[$i] .= "<td bgcolor=\"".$color."\" width=\"110\">".$f_lista['hora_cadastro']."</td>";
$html[$i] .= "</tr>";
$i++;
}
$html[$i] .= '</tbody>';
$html[$i] .= '</table>';
$arquivo = 'ds.xls';
header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header ("Last-Modified: " . gmdate("D,d M YH:i:s") . " GMT");
header ("Cache-Control: no-cache, must-revalidate");
header ("Pragma: no-cache");
header ("Content-type: application/x-msexcel");
header ("Content-Disposition: attachment; filename={$arquivo}" );
header ("Content-Description: PHP Generated Data" );
for($i=0;$i<=$contar;$i++){
echo $html[$i];
}
As linhas 64 até 70 são dos ( HEADER )
Warning: Cannot modify header information - headers already sent by (output started at /home/wwwtata/public_html/tata-mar/excel.php:2) in /home/wwwtata/public_html/tata-mar/excel.php on line 64
Warning: Cannot modify header information - headers already sent by (output started at /home/wwwtata/public_html/tata-mar/excel.php:2) in /home/wwwtata/public_html/tata-mar/excel.php on line 65
Warning: Cannot modify header information - headers already sent by (output started at /home/wwwtata/public_html/tata-mar/excel.php:2) in /home/wwwtata/public_html/tata-mar/excel.php on line 66
Warning: Cannot modify header information - headers already sent by (output started at /home/wwwtata/public_html/tata-mar/excel.php:2) in /home/wwwtata/public_html/tata-mar/excel.php on line 67
Warning: Cannot modify header information - headers already sent by (output started at /home/wwwtata/public_html/tata-mar/excel.php:2) in /home/wwwtata/public_html/tata-mar/excel.php on line 68
Warning: Cannot modify header information - headers already sent by (output started at /home/wwwtata/public_html/tata-mar/excel.php:2) in /home/wwwtata/public_html/tata-mar/excel.php on line 69
Warning: Cannot modify header information - headers already sent by (output started at /home/wwwtata/public_html/tata-mar/excel.php:2) in /home/wwwtata/public_html/tata-mar/excel.php on line 70
Carregando comentários...