Posts Tagged ‘PHP’

How to write and read files from php

This is a simple and basic example about how to write and read files from php, this code shows you the minimal use of fputs() fclose(), fopen().

Read the rest of this entry »

htmlentities($string,ENT_NOQUOTES, ‘UTF-8′)

Estuve peleando como pendejo contra el puto encoding de html en Internet Explorer, por que resulta que la mamada esa no sabe interpretar el meta tag <meta http-equiv=”Content-Type” content=”text/html; charset=utf8″ /> y fué un verdadero pedo encontrar la sintáxis adecuada de htmlentities() para que funcionara bien, después de mucho interpretar el manual, dejo a su [...]

Read the rest of this entry »

sql_insertar() – pg_send_prepare && pg_send_execute

Function to create dinamically a valid INSERT INTO SQL instruction, using an array as any parameter and iterating over him to extract the name and values to use it as field names and field values. This function uses pg_send_prepare and pg_send_execute php built-in functions and shows in a detail how to use them.

Read the rest of this entry »

How to send parameters from js to php with prototype in CodeIgniter

Descripción de envío de parametros desde javascript usando prototype a un php usando el framework CodeIgniter y el MVC.

Read the rest of this entry »

Programación

He estado pensando acerca de unas cuantas cosas que he hecho en PHP con CodeIgniter, me dí cuenta que sí en una función de PHP recibes 1 solo parametro entre controladores y modelos te ahorras unos cuantos teclazos…. Ejemplo de caso habitual de paso de parametros entre controlador y modelo: ****Controlador***** <?php if (! defined(‘BASEPATH’) [...]

Read the rest of this entry »

dev_mode

Como aplicar una variable que diga si estas en desarrollo ó en producción en PHP usando el framework CodeIgniter

Read the rest of this entry »