myitalan Posted July 17, 2012 Share Posted July 17, 2012 Greetings, I thought I was done.. I had this part working first but now that i fixed the read part... the write part broke. Please help!! i am trying to update or (delete a record based on title) from the xml. here is the form: <form action="processForm.php" method="post"> <fieldset> <label for="title">Title:</label> <input type="text" id="title" name="title"/><br /> <label for="description">Description:</label><input type="text" id="description" name="description" /><br /> <select name="action"> <option value="ins">Insert</option> <option value="del">Delete</option> </select> <input type="submit" /> </fieldset> </form> ................................ and here is the php: <? $doc = new DOMDocument(); $doc->load( 'playlist.xml' ); $r = $doc->getElementsByTagName("gallery")->item(0); $b = $doc->createElement("images"); $title = $doc->createElement("title"); $title->appendChild( $doc->createTextNode( $imges["title"] ) ); $b->appendChild( $title ); $description = $doc->createElement("description"); $description->appendChild( $doc->createTextNode( $imges["description"] ) ); $b->appendChild( $description ); $tmb = $doc->createElement("tmb"); $tmb->appendChild( $doc->createTextNode( $imges["tmb"] ) ); $b->appendChild( $tmb ); $img = $doc->createElement("img"); $img->appendChild( $doc->createTextNode( $imges["img"] ) ); $b->appendChild( $img ); $r->appendChild( $b ); $doc->save("playlist.xml"); .................... a couple of things: - I only have to input filelds in the form : title, description as the img and tmb is preloaded. Please help. Quote Link to comment https://forums.phpfreaks.com/topic/265853-updating-using-dom/ Share on other sites More sharing options...
myitalan Posted July 17, 2012 Author Share Posted July 17, 2012 i seem to really have difficult request or being new to coding I'm not getting my request across. If you view this post please at least help me to know which it is. If it's too difficult, please point me to a simpler way or if you don't understand, state so then I could retry. Thanks for all your help. Quote Link to comment https://forums.phpfreaks.com/topic/265853-updating-using-dom/#findComment-1362269 Share on other sites More sharing options...
myitalan Posted July 18, 2012 Author Share Posted July 18, 2012 here is s simple tutorial http://www.4guysfromrolla.com/webtech/122800-1.shtml Only thing... it's ASP. i'm not sure if I'm suppose to say that here but my fellow PHP Gurus are silent. ... just pulling your chain in hopes to get a little help. GodBless... last post if no reply Quote Link to comment https://forums.phpfreaks.com/topic/265853-updating-using-dom/#findComment-1362323 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.