Tema: Php - excel
Ver Mensaje Individual
  #1 (permalink)  
Antiguo 02/08/2012, 15:25
nachosb
 
Fecha de Ingreso: noviembre-2010
Mensajes: 4
Antigüedad: 13 años, 5 meses
Puntos: 0
Php - excel

Bueno este es mi primer post ojala me ayuden .
Queria saber como exportar una tabla html con una imagen dentro desde mi php .
el codigo que utilizo es el siguiente pero no me imprime la imagen .


excel_manuel.php

if(isset($_POST['crear']) and $_POST['crear'] == 'Crear PDF' ){
$f = "tabla_". date('YmdHis').".xls";
$arch = fopen($f,"w+");
$tabla = htmlspecialchars_decode(tabla());
fwrite($arch, $tabla);
fclose($arch);
header ("Content-Disposition: attachment; filename=".$f."\n\n");
header ("Content-Type: application/vnd.ms-excel");
readfile($f);
exit;
}

function tabla(){
$t = '<table border=1>';
$t .='<tr>';
$t .='<td><img src="css/logo.jpg"></td>';
$t .='</tr>';
$t .='</table>';
return $t;
}
echo
'<form method="post" action="excel_manuel.php">
<head>
</head>
<body>';

echo 'Cantidad :<input type="text" name="cantidad" size="20"><br/>
<input type="submit" name="crear" value="Crear PDF">
<br>
</ br>';
echo '</body>


</form>';