Ver Mensaje Individual
  #1 (permalink)  
Antiguo 20/09/2010, 15:07
Avatar de gachon
gachon
 
Fecha de Ingreso: septiembre-2004
Ubicación: En Google
Mensajes: 462
Antigüedad: 19 años, 7 meses
Puntos: 3
variable de formulario en addchild de simplexml

Hola muy buenas,
estoy intentando mandar un texto ,de un texterea que esta en un formulario, a un archivo xml, el problema es que me da error y no me mete el texto dentro del xml $_POST['Comentario'];
codigo del post enviar
Código PHP:
$source 'content.xml';
$sitemap=simplexml_load_file($source) or die("Unable to load XML!");
$indice=0;
$image $sitemap->gallery[$indice]->addChild('image');

$coment=$_POST['Comentario'];

$x=simplexml_load_string('<text>'.$coment.'</text>'); //linea19

$image->addChild('comentarios',$x);

file_put_contents($source$sitemap->asXML()); 
y este es el error que me da
Código PHP:

Warning
simplexml_load_string() [function.simplexml-load-string]: Entityline 1parser error Input is not proper UTF-8indicate encoding Bytes0xA1 0x0D 0x0A 0x70 in C:wampwwwNuevacarpeta2addimagen.php on line 19

Warning
simplexml_load_string() [function.simplexml-load-string]: <text>Comenta tu foto or¡ in C:wampwwwNuevacarpeta2addimagen.php on line 19

Warning
simplexml_load_string() [function.simplexml-load-string]: ^ in C:wampwwwNuevacarpeta2addimagen.php on line 19