Ver Mensaje Individual
  #3 (permalink)  
Antiguo 08/12/2008, 09:41
Avatar de pablosky13
pablosky13
 
Fecha de Ingreso: septiembre-2008
Mensajes: 42
Antigüedad: 15 años, 7 meses
Puntos: 0
Respuesta: ...XML....actualizable

Ya cabros.....hice una parte de este embrollo, pude generar el archivo.xml sin problemas con este codigo
Código PHP:
<?Php
$chao 
$_POST["chao"];

$arreglo_nombres=array(

"TITULO"=>$TITULO $_POST["TITULO"],
"LINK"=>$LINK $_POST["LINK"],
"RESUMEN"=>$RESUMEN $_POST["RESUMEN"],
"NOTICIACOMPLETA"=>$NOTICIACOMPLETA $_POST["NOTICIACOMPLETA"],

); 

$buffer='<?xml version="1.0" encoding="utf-8"?> 

   <!-- Generando XML...--> 
   
           <file_xml> <NOTICIA>'

           
  while (list (
$etiqueta$valor) = each ($arreglo_nombres)): 
  
$buffer.="<$etiqueta>$valor</$etiqueta>"
  endwhile; 
  
$buffer.="</NOTICIA>"
  
$buffer.="</file_xml>"
  
$file=fopen("archivo.xml","w+"); 
  
fwrite ($file,$buffer); 
  
fclose($file); 
?>
pero ahora, el tema es actualizarlo y sumarle datos.....para eso debia utilizar el codigo ke les mostre anteriormente (post anterior) y sumarlo al que les mostre ahora, porque se supone que funciona....pero no

Código PHP:
<?
$buffer
='<noticia>'
           
  while (list (
$etiqueta$valor) = each ($arreglo_nombres)): 
    
$buffer.="<$etiqueta>$valor</$etiqueta>"
  endwhile; 
  
$buffer.="</noticia>"
  
$buffer.="</file_xml>"
  
$file=fopen("archivo.xml","w+"); 
  
fwrite ($file,$buffer); 
  
fclose($file);
  
   if(
file_exists("archivo.xml")){
       
$archivo "archivo.xml";
       
$gestor fopen($archivo"a+");
       
fwrite($gestor"$buffer");
       
fseek($gestor0);
   } else {
       
$archivo "archivo.xml";
       
$gestor fopen($archivo"a+");
       
fwrite($gestor"<?xml version='1.0' encoding='iso-8859-1'?><informacion>");
       
fwrite($gestor"$buffer");
       
fwrite($gestor"</informacion>");
   }
?>
Gracias