INGRESO LOS REGISTROS OBTENIDOS DEL FORMULARIO AL XML
Código PHP:
$xml = simplexml_load_file('xml/custom.xml', null, true);
$xml->addAttribute('tipo', 'documental');
$track = $xml->addChild('video');
$track ->addchild('title', $_POST['titulo'] );
$track ->addchild('youtube',$_POST['codigo'] );
$track ->addchild('details', $_POST['detalle']);
$_POST['titulo'] ;
$_POST['codigo'] ;
$_POST['detalle'] ;
$xml->asXML('xml/custom.xml');
Pero no logro que me agregue asi:
<video tipo="Documental" >
Y ademas me sale este warning :s
Código:
Gracias Warning: SimpleXMLElement::addAttribute() [function.SimpleXMLElement-addAttribute]: Attribute already exists in F:\easy\EasyPHP 2.0b1\www\public_html\agregar-empresas.php on line 32