Ver Mensaje Individual
  #10 (permalink)  
Antiguo 27/08/2008, 09:36
radge
 
Fecha de Ingreso: enero-2004
Ubicación: here I Am
Mensajes: 437
Antigüedad: 20 años, 3 meses
Puntos: 1
Respuesta: script en php para llamar otro archivo

Mira el codigo es este


Código PHP:
<?
include('conf.php');
global 
$link;

foreach( 
range110 ) as $i )
{
    
$salida "<?xml version=\"1.0\" encoding=\"UTF-8\"?"
    
.">"
    
."<urlset xmlns=\"http://www.google.com/schemas/sitemap/0.84\""
    
.">";

    
$salida.="<url>"
    
."<loc>http://web/index.php</loc>"
    
."</url>";

    
$consulta mysql_query("select * from tabla where campo='$i'",$link);

    while(list(
$cadena,$fecha) = mysql_fetch_row($consulta))

    {
        
$salida.= "<url>"
        
."<loc>http://url/$cadena/</loc>"
        
."<lastmod>".date('Y-m-d')."</lastmod>"
        
."</url>";
    }


    
$salida.= "</urlset>";
    
$file fopen("/home/xxx/sitemap/sitemap$i.xml""w");
    
fwrite($file$salida);
    
fclose($file);

    
ob_clean();

    
header("Content-type: application/xml");
}
Si lo pongo dentro del foreach... entonces

Warning: Cannot modify header information - headers already sent by (output started at /home/planetka/public_html/radge/web2/conf.php:69) in /home/xxx/web2/crearxml.php on line 35

Es decir la linea

header("Content-type: application/xml");
__________________
Nuevo foro sobr el mundo del motor - Renault foro
http://www.renaultforo.com