Ver Mensaje Individual
  #10 (permalink)  
Antiguo 24/08/2008, 20:58
Avatar de ElJavista
ElJavista
Colaborador
 
Fecha de Ingreso: marzo-2007
Ubicación: Lima Perú
Mensajes: 2.231
Antigüedad: 17 años, 1 mes
Puntos: 67
Respuesta: mostrar un .txt desde html

Código PHP:
//Para cargar el texto
$texto fopen("archivo.txt""r");

//Para mostrarlo
echo nl2br($texto); 
Eso está muy mal, el fopen no devuelve el texto del archivo señalado, solo devuelve un tipo de variable llamado source, para tomar el contenido de un archivo se debe hacer algo mas, el código quedaría así:

Código PHP:
$fp fopen("archivo.txt""r");
$text fread($fpfilesize("archivo.txt");
//Para mostrarlo
echo nl2br($texto);