Mira el codigo es este
Código PHP:
<?
include('conf.php');
global $link;
foreach( range( 1, 10 ) 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");