necesito que cuando se descargue o exporte la tabla mysql a el excel este ponga bien las tildes y las ñ
ya he probado
pero no funciona si me pueden ayudar diciendome por donde tengo el error o bien diciendome cual es mi error , agradecido estare...
Código PHP:
Ver original<?php
//conexion a base de datos MySql
include_once("../class/class.php");
if(isset($_SESSION['admin2'])) {
$sql = "SELECT * FROM contacto ORDER BY fecha ASC";
$return .= '<table border=1>';
$cols = 0;
$return .= '<tr>';
if($cols==0){
for($i=0; $i<$cols; $i++){
$cols_names[$i] = $col_name;
}
$return .= '</tr><tr>';
}
for($i=0; $i<$cols; $i++){
#En esta iteraci車n podes manejar de manera personalizada datos, por ejemplo:
if($cols_names[$i] == 'fechaAlta'){ #Fromateo el registro en formato Timestamp
}else if($cols_names[$i] == 'activo'){ #Estado l車gico del registro, en vez de 1 o 0 le muestro Si o No.
}else{
}
}
$return .= '</tr>';
}
$return .= '</table>';
}
header("Content-type: application/vnd-ms-excel; charset=iso-8859-1"); header("Content-Disposition: attachment; filename=ContactosWeb_".date('d-m-Y').".xls"); echo $return; }
else
{
?>
<!doctype html>
<html lang="en">
<head><meta http-equiv="Content-Type" content="text/html; charset=big5">
<title>Document</title>
<style>
h1{
text-align: center;
margin-top: 14%;
color:#fff;
}
h1 a{
color: #fff;
}
</style>
</head>
<body style="background-color:#254584;">
<h1>Debes loguearte en <a href='index.php'>el formulario de login</a> para poder acceder.</h1>
</body>
</html>
<?php
}
?>