Member Avatar

Hi, I want to add element after an element with loop. For example, I have 10 paragraph elements and I want to add div element after each paragraph element. How can I do it?

Member Avatar
0
20
Member Avatar

I have a problem while creating an xml file in php.I am not getting th root element.But all other elements are been outputted in the result.What might be the reason????Any help would be appreciated.The code is depicted below.order is my root element. <?php $url='success.xml'; //$xml = simplexml_load_file($url); $name = htmlentities($_POST['name']); $age = htmlentities($_POST['age']); $doc = new DOMDocument(); $root=$doc->createElement("order"); $doc->appendChild($root); $textareaNode = $doc->createElement("name"); $textNode = $doc->createTextNode($name); $textareaNode->appendChild($textNode); $doc->appendChild($textareaNode); $textareaNode = $doc->createElement("age"); $textNode = $doc->createTextNode($age); $textareaNode->appendChild($textNode); $doc->appendChild($textareaNode); //header('Content-Type: text/xml'); echo $doc->save($url); ?> the above is my getdata.php page <html> <body> <form name="form" action="getdata.php" method="post"> <table> <tr> <td>name</td> <td><input type="text" name="name" /></td> </tr> …

Member Avatar
0
6

The End.