Ver Mensaje Individual
  #15 (permalink)  
Antiguo 16/01/2013, 21:09
Avatar de Most
Most
 
Fecha de Ingreso: marzo-2009
Mensajes: 642
Antigüedad: 15 años, 1 mes
Puntos: 6
Respuesta: limite en archivo de texto

Bueno, ya lo he probado, me crea el archivo, pero sin ningun texto, el codigo lo he dejado asi:

Código PHP:
<?php
//Obtenemos ID
$id=$_GET[id];
//Seleccionamos BD
require("conexion.php");
$res=mysql_query("select * from navi where id_navi='$id'",$connect);

$counter=0;
$text="";
$currentFile=null;
 
$cabecera="Esta es mi cabecera"
$pie="Este es mi pie";
 
// $res es el resultado de mysql_query de tu consulta.
while($row=mysql_fetch_array($res))
{
     if(
$counter%40==0)
     {
            if(
$currentFile!=null)
            { 
                
fwrite($pie,$currentFile);           
                
fclose($currentFile);
             }
             
$currentFile=fopen("miFichero".($counter/40).".txt","w");
             
fwrite($cabecera,$currentFile);
     }
    
fwrite("# ".$row[id_navi]."\n
            type=video\n
            name="
.$row[titulo]."\n
            thumb="
.$row[caratula]."\n
            URL="
.$row[url]."\n
            "
.$row[procesador]."\n\n
            "
,$currentFile); 
    
$counter++; 
}
if(
$currentFile)
     
fclose($currentFile);

header("location: publicaciones.php");
  
?>
Tampoco se ha escrito el texto de cabecera, no se si sera por que he hecho algo mal y da conflicto o algo..

a este archivo lo lleva este link: <a class="button" href="validar.php?id='.$row[id_navi].'">Validar</a>