hi guys i need urgent help… i am dead lock… i need to finish this as soon as possible.
my problem is:-
flash > php > xml. #flash will read data from xml.
flash will send data to php.
php will convert/add data to xml.
than from that xml flash will read data and display.
its comment box, like message posting.
I have succeeded up to making xml data from php. But the problem is each time php is adding data to xml. Its not adding data to next line. it is appending data to xml structure rather than adding data to next line.
here is the php code
<?php
// create doctype
$dom = new DOMDocument("1.0");
// create root element
$root = $dom->createElement("content");
$dom->appendChild($root);
$dom->formatOutput=true;
//$senderName = $_REQUEST['namE'];
//$commentAdded .= .$_REQUEST['comments'].;
// create child element
$item = $dom->createElement("contents");
$root->appendChild($item);
// create attribute node
$price = $dom->createAttribute("namE");
$item->appendChild($price);
// create attribute value node
$priceValue = $dom->createTextNode($_POST['namE']);
$price->appendChild($priceValue);
// create attribute node
$address = $dom->createAttribute("comments");
$item->appendChild($address);
// create attribute value node
$priceValue = $dom->createTextNode($_POST['comments']);
$address->appendChild($priceValue);
// save tree to file
$dom->save("contacts.xml");
//echo $commentAdded;
// save tree to string
$order = $dom->save("contacts.xml")."
";
?>
what i need is. It should add data to current xml data structure. to the next line.
realy i need urgent help. Please tell me how to achive this.