como poder mostrar la info en pantalla y poder exportarlo a un excel por medio de un boton, lo tengo exo pero no me lo muestra en pantalla y me lo gurda automaticamente, la idea esq salga un boton que diga guardar eso aki esta el codigo
Código PHP:
Ver original<?php
$sql = "select usuarios,nombreusuario,grupo,nombregrupo from resultados1";
if($d>0)
{
header ('Content-type: application/vnd.ms-excel'); header ('Content-Disposition: attachment;filename=archivoRacf.xls');
echo ("<table border= 1 >");
echo ("<tr>");
echo ("<td>CodUsuario</td>");
echo ("<td>NombreUsuario</td>");
echo ("<td>codGrupo</td>");
echo ("<td>NombreGrupo</td>");
echo ("</td>");
echo ("<tr>");
echo ("<td>$registro[0]</td>");
echo ("<td>$registro[1]</td>");
echo ("<td>$registro[2]</td>");
echo ("<td>$registro[3]</td>");
echo ("</td>");
}
echo ("</table>");
}
else{
echo ("no ahi registros");
}
?>