right ok thanks for the help so far, i have looked at the DOMDocument class as that is how it loads the XML Data for the portfolio testimonials at the moment.
i have a script there now to open the xmlfile and append a new child elemen to it then save the new document but im getting this error:
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /home/a8186275/public_html/scripts/submitcomment.php on line 6
PHP Code:
<?php
$doc = new DOMDocument();
$doc->load( '../pendingtestimonials.xml');
$holder = doc->createElement('testimonial','');
$element1 = $doc->createElement('name', $_POST['name']);
$element2 = $doc->createElement('location', $_POST['location']);
$element3 = $doc->createElement('comment', $_POST['comment']);
$holder->appendChild($element1);
$holder->appendChild($element2);
$holder->appendChild($element3);
$doc->appendChild($holder);
$doc->saveXML();
$doc = new DOMDocument();
$doc->load( '../pendingtestimonials.xml');
echo($doc);
?>
any ideas???
Bookmarks