Hola Amigos del foro:
Como puedo importar datos de excel a mysql con php, yo he hecho lo siguiente y me sale, solo escojo el archivo excel y plasma en la pag todos los datos del excel pero.....
sale solo si es local osea si lo ejecuto desde mi pc, pero cuando lo ejecuto desde el server me sale esto
The filename C:\\AppServ\\www\\consultas\\prueba.xls is not readable
tendra q ver con lo q el server tiene linux?? y si es asi como lo soluciono?
aca les dejo el codigo pa q vean
<html><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><style type="text/css">
</style><center><strong><h1>Pago a Proveedores</h1></strong></center><title></title></head><body>
<p align="center">
<form name="form1" method="post" action="">
<div align="left">
<input name="cExaminar" type="file" id="cExaminar">
<input name="cConsultar" type="submit" id="cConsultar" value="Consultar">
</div>
</form>
<p align="left">
<strong>
<table width="602" border="1" class="Estilo4">
<tr>
<th width="39" bgcolor="#CCCCCC" scope="col"><div align="center" class="Estilo4"><font color="#0000FF">Cia</font></div></th>
<th width="245" bgcolor="#CCCCCC" scope="col"><div align="center" class="Estilo4"><font color="#0000FF">Cliente</font></div></th>
<th width="93" bgcolor="#CCCCCC" scope="col"><div align="center" class="Estilo4"><font color="#0000FF">Tarjeta</font></div></th>
<th width="116" bgcolor="#CCCCCC" scope="col"><div align="center" class="Estilo4"><font color="#0000FF">Simbolo</font></div></th>
<th width="75" bgcolor="#CCCCCC" scope="col"><div align="center" class="Estilo4"><font color="#0000FF">Disponible</font></div></th>
</tr>
<?php
$nombre_archivo = $_POST['cExaminar'];
if (is_readable($nombre_archivo)) {
echo 'Es posible leer el archivo';
} else {
echo 'No es posible leer el archivo';
}
?>
<?php
require_once './Excel/reader.php';
$data = new Spreadsheet_Excel_Reader();
$data->setOutputEncoding('CP1251');
if (isset($_POST['cConsultar']))
{
$data->read($_POST['cExaminar']);
error_reporting(E_ALL ^ E_NOTICE);
for ($i = 1; $i <= $data->sheets[0]['numRows']; $i++)
{
echo "<tr><td>".$data->sheets[0]['cells'][$i][1]."</td>";
echo "<td>".$data->sheets[0]['cells'][$i][2]."</td>";
echo "<td>".$data->sheets[0]['cells'][$i][3]."</td>";
echo "<td>".$data->sheets[0]['cells'][$i][4]."</td>";
echo "<td>".$data->sheets[0]['cells'][$i][5]."</td></tr>";
}
}
else
{
echo 'no hay registros';
}
?>
</table>
</body>
</html>