Ale kiedy chce dodac nastepny rekord pod tym obecnym to juz ciezej. a teraz kod:
<html> <body> <form method="POST"> Action: <select name="action"> <option value="Select">Select</option> <option value="Wash 7?">Add Wash</option> <option value="Mini Valet 50?">Add Mini Valet</option> <option value="Wash & Vac 20?">Add Wash & Vac</option> <option value="Full Valet 120?">Add Full Valet</option> </select> <br/> Other: <input name="other" type="text">Price:<input name="price" type="text"> <input type="submit" Value="Add"> </form> </body> </html> <?php $action=$_POST['action']; $other=$_POST['other']; $price=$_POST['price']; $dane='<?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="xsl.xsl"?> <SERWIS> <ACTION> <ORDINARY>'.$action.'</ORDINARY> <OTHER>'.$other.'</OTHER><PRICE>'.$price.'</PRICE> </ACTION> </SERWIS> '; $newa = new DOMDocument(); $newa -> load('action.xml'); //Get the <ACTION> tag $add = $newa -> getElementsByTagName('ACTION'); //Create the new <new_rec> tag $newGame = $newa -> createElement("new_rec"); $newGame -> appendChild($newa -> createElement("ORDINARY", '.$action.')); $newGame -> appendChild($newa -> createElement("OTHER", '.$other.')); $newGame -> appendChild($newa -> createElement("PRICE", '.$price.')); //Add the new <new_rec> tag under the <ACTION> tag $add -> item(0) -> appendChild($newGame); //Save again $newa -> save('action.xml'); ?>
no i blady:
Warning: DOMDocument::load(): Input is not proper UTF-8, indicate encoding ! Bytes: 0x80 0x3C 0x2F 0x4F in file:///C:/wamp/www/action.xml, line: 5 in C:\wamp\www\simple.php on line 36
Fatal error: Call to a member function appendChild() on a non-object in C:\wamp\www\simple.php on line 48
Szukalem w google probowolem roznych opcji/ zmian kodu. Nie ogarniam. 1 raz robie zapis pliku XML a jeszcze przedema odczyt i wyswietlenie do druku

Ale tymczasem jakies podpowiedzi (gotowe rozwiazania hahah [taki zarcik]
