edito , resolvi mi problema eran las comillas dejo el script por si alguien tiene el mismo problema .
Código PHP:
Ver original<?php
require_once("../conexion/conexion.php");
$buscar=$_GET['palabra'];
header('Expires: Sat, 26 Jul 1997 05:00:00 GMT'); // Date in the past header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); header('Cache-Control: no-store, no-cache, must-revalidate'); // HTTP/1.1 header('Cache-Control: pre-check=0, post-check=0, max-age=0'); // HTTP/1.1 header('Content-Transfer-Encoding: none'); header('Content-Type: application/vnd.ms-excel'); // This should work for IE & Opera header('Content-type: application/x-msexcel'); // This should work for the rest header('Content-Disposition: attachment; filename="Informe.xls"');
$sql = "SELECT unifica_proyectos.id,
unifica_proyectos.nombreencuesta,
unifica_proyectos.fecha,
unifica_proyectos.rut,
unifica_proyectos.nombreevaluador,
unifica_proyectos.idregion,
unifica_proyectos.coordinador,
unifica_proyectos.mail,regiones.idregion,
regiones.region
FROM unifica_proyectos INNER JOIN regiones ON unifica_proyectos.idregion = regiones.idregion
WHERE unifica_proyectos.fecha ='".$buscar."'";
$fecha=$row['fecha'];
$rut=$row['rut'];
echo "<table xmlns:o='urn:schemas-microsoft-com:office:office' xmlns:x='urn:schemas-microsoft-com:office:excel' xmlns='http://www.w3.org/TR/REC-html40'>
<tr>
<td>$nombreencuesta</td>
<td>$fecha</td>
<td>$rut</td>
<td>$nombreevaluador</td>
<td>$region</td>
<td>$coordinador</td>
<td>$mail</td>
</tr>
</table>";
}
?>
saludos