File "generarExcel.php.bak"

Full Path: C:/wamp64/www/sistemas/servidores/generarExcel.php.bak
File size: 1.03 KB
MIME-type: text/x-php
Charset: utf-8

<?php
include("connection.php");
header("Content-Type: application/vnd.ms-excel");
header("Content-Disposition: attachment; filename=servidores_".date('Y-m-d').".xls");

$con = connection();
$sql = "SELECT * FROM servidores ORDER BY id DESC";
$query = $con->query($sql);

echo "<table border='1'>";
echo "<tr>
        <th>ID</th>
        <th>Nombre Servidor</th>
        <th>Usuario Admin</th>
        <th>ContraseƱa</th>
        <th>URL</th>
        <th>Base Datos</th>
        <th>ContraseƱa DB</th>
      </tr>";

while ($row = $query->fetch_assoc()) {
    echo "<tr>
            <td>".$row['id']."</td>
            <td>".htmlspecialchars($row['nombre_servidor'])."</td>
            <td>".htmlspecialchars($row['usuario_admin'])."</td>
            <td>".htmlspecialchars($row['contrasena'])."</td>
            <td>".htmlspecialchars($row['URL'])."</td>
            <td>".htmlspecialchars($row['base_datos'])."</td>
            <td>".htmlspecialchars($row['contrasena_DB'])."</td>
          </tr>";
}
echo "</table>";
?>