[ad_1]
I am trying to add a product in php, all in xml, here is what I have already done:
$file = file_get_contents('php://input');
$xml = simplexml_load_file($file);
$product = new Product($xml->id);
$dom = new DOMDocument;
$xml->id = $product->id = "29";
$xml->name = $product->name = "Baptiste";
$xml->price = $product->price = "90";
$xml->description = $product->description = "loricup Ilicum Bababcom OEGZJpodbnsoqdqsfkjifhum";
$id = $dom->createElement('id', "$xml->id");
$name = $dom->createElement('name', "$xml->name");
$price = $dom->createElement('price', "$xml->price");
$description = $dom->createElement('description', "$xml->description");
$dom->appendChild($id);
$dom->appendChild($name);
$dom->appendChild($price);
$dom->appendChild($description);
$dom->formatOutput = true;
$this->output .= $dom->saveXML();
This is why I am appealing to you to try to help me!
thank you in advance for your help
[ad_2]