Mira puse asi:
Código PHP:
Ver originalif (!empty($_POST["dirper"])){ $contotal.='<td>'.muestra($fila[cod_dato]).'</td>';
$titulo.="<th> DIRECCION PARTICULAR </th>";
}
header("Content-type: application/vnd.ms-excel"); header("Content-Disposition: filename=Autoridades_".date('d-m-Y_His').".xls");
echo "<table border=1>";
echo $titulo;
foreach($datos as $fila){
echo "<tr><td>$fila[apellidos]</td><td>$fila[nombres]</td>".$contotal."</tr>";
}
echo "</table>";
y sigue sin funcionar...