$htext = $doc->createTextNode($_POST['headline']); $head->appendChild($htext); //create navlabel $head = $doc->createElement("navigationlabel"); $root->appendChild($head); $htext = $doc->createTextNode($_POST['navlabel']); $head->appendChild($htext); //create abstract $abs = $doc->createElement("description"); $root->appendChild($abs); $abstext = $doc->createTextNode($_POST['description']); $abs->appendChild($abstext); //create body $body = $doc->createElement("body"); $root->appendChild($body); $cdata = $doc->createCdataSection($_POST['body']); $body->appendChild($cdata); //create status $stat = $doc->createElement("status"); $root->appendChild($stat); $stext = $doc->createTextNode($_POST['status']); $stat->appendChild($stext); //create pubDate $pub = $doc->createElement("pubdate"); $root->appendChild($pub); $pubtext = $doc->createTextNode($_POST['pubDate']); $pub->appendChild($pubtext); //write to the file $filename = "../xml/" . $id . ".xml"; $doc->save($filename); header("Location:webcopytool.php");
$atext = $doc->createTextNode($_POST['authorid']); $author->appendChild($atext); //create categoryID $cat = $doc->createElement("categoryid"); $root->appendChild($cat); $ctext = $doc->createTextNode($_POST['categoryid']); $cat->appendChild($ctext); //create abstract $abs = $doc->createElement("url"); $root->appendChild($abs); $abstext = $doc->createTextNode($_POST['url']); $abs->appendChild($abstext); //create body $body = $doc->createElement("description"); $root->appendChild($body); $cdata = $doc->createCdataSection($_POST['description']); $body->appendChild($cdata); //create keywords $key = $doc->createElement("keywords"); $root->appendChild($key); $ktext = $doc->createTextNode($_POST['keywords']); $key->appendChild($ktext); //create status $stat = $doc->createElement("status"); $root->appendChild($stat); $stext = $doc->createTextNode($_POST['status']); $stat->appendChild($stext); //create expireDate $ex = $doc->createElement("expiredate"); $root->appendChild($ex); $xtext = $doc->createTextNode($_POST['expiredate']);