Diego Di Camillo

Base de tips para problemas comunes de los desarrolladores.



Automaticamente append o prepend archivos PHP utilizando .htaccess

10Ago11

Supongamos que tengo los siguientes archivos:

prepend.php

echo "

this is the prepended file

\n";

main.php

echo "

this is the main file

\n";

append.php

echo "

this is the append file

\n";

Si agregamos en el .htaccess las siguientes lineas:

php_value auto_prepend_file prepend.php
php_value auto_append_file append.php

Y navegamos en el archivo main.php en nuestro browser, lo que obtendriamos es:

this is the prepended file

this is the main file

this is the appended file

El comando php_value auto_prepend_file archivo.php en htaccess ANTEPONE el resultado de la ejecucion de archivo.php

Y por supuesto php_value auto_append_file archivo.php en htaccess ADICIONA el resultado de la ejecucion de archivo.php

Si NO QUEREMOS NINGUNA EJECUCION prepend ni append podemos poner en el htaccess:

php_value auto_append_file none
php_value auto_prepend_file none
Archivado en: Apache, configuraciones, General, HTML   |  0 Comentarios

Sin comentarios a “Automaticamente append o prepend archivos PHP utilizando .htaccess”  

Feed de este artículo URI para Trackbacks
  1. No hay comentarios
Enviando tu Comentario
Por favor espera

Deja una respuesta

Hubo un error con tu comentario, por favor intenta de nuevo.



Comparte este artículo

  • Menéame  Menéalo
  • del.icio.us  Enviar a Del.icio.us
  • Mi Yahoo!  Agregar a Mi Web 2.0
  • Furl  Guardar en Furl
 


wordpressk2openswitchyukei.netfeedwordpress