Aplicaciones Web, Software, iPhone... a medida

Blog


Exportar tabla PHP a Excel

11.08.11 Posted in Programación by

Aquí va el código PHP:

header(“Pragma: public”);

header(“Expires: 0″);

$filename = “table.xls”;

header(“Content-Type: application/vnd.ms-excel”);

header(“Content-Disposition: attachment; filename=$filename”);

header(“Pragma: no-cache”);

header(“Cache-Control: must-revalidate, post-check=0, pre-check=0″);

echo ‘<table>…</table>’;

 

 

 


Guardar todo el contenido de una página html (o PHP) en una variable PHP

10.07.11 Posted in Programación by

//La variable ‘buffer’ almacenará todo el contenido que debería salir por pantalla

<?php

ob_start();

?>

 

<html>
<body>
<p>TEXT.</p>
</body>
</html>

 

<?php

$buffer = ob_get_contents();

@ob_end_clean();

@ob_end_flush();

?>


Crear un archivo comprimido zip con contrasenya (password) en MAC

07.30.11 Posted in Sin categoría by

Abrir un terminal y escribir:

$ zip -ejr Nombre_zip_que_queremos_crear.zip path_archivo_o_carpeta_que_queremos_comprimir

Y listos!


HTTP GET (Http Web Request) request en Javascript?

06.22.11 Posted in Programación by

Necesitas llamar a una URL y recoger lo que devuelve en Javascript?

JS Code
function httpGet(URL_string)
{
var xmlHttp = null;
xmlHttp = new XMLHttpRequest();
xmlHttp.open( “GET”, URL_string, false );
xmlHttp.send( null );
return xmlHttp.responseText;
}