AllemiAngesse
New Member
\[code\]<?php$files = glob('users/*.xml');foreach($files as $file) { $xml = new SimpleXMLElement($file, 0, true); echo ' <tr> <td><input type="radio" name="browser" onclick="check(this.value)" value="'. basename($file) .'"></td> <td class="alternate-row1">'. basename($file, '.xml') .'</td> <td><span id="itm1" onclick="exchange(this.id)">'. $xml->name .'</span><input id="itm1b" class="replace" type="text" name="newname"></td> <td class="alternate-row1">'. $xml->lastname .'</td> <td>'. $xml->email .'</td> <td class="alternate-row1">'. $xml->level .'</td> <td>'. $xml->birthday .'</td> <td class="alternate-row1">'. $xml->gender .'</td> <td>'. $xml->age .'</td> <td class="alternate-row1">'. $xml->country .'</td> </tr>';}session_start();if (isset($_POST['save'])){ $member = $_POST['newname']; $dom = new DOMDocument(); $dom->load('users/' . basename($file) . '.xml'); $editname = $dom->getElementsByTagName('name'); $newname = $dom->createTextNode($member); foreach ($editname as $edit) { $edit->parentNode->replaceChild($newname, $edit); } $dom->save('users/' . basename($file) . '.xml');}?>\[/code\]So I've made this code, as you can see it got DOM and Simple XML element.I trying to replace child using \[code\]$_POST\[/code\] throw input command, the input box is in the echo part above and I using js replacement code, it replace text to input text by onclick command (not really important for my question, it just for explaining).Anyway I got little stuck with the code since it not working, I got set the \[code\]$_POST\[/code\], I try use some guides I found in Stack Overflow but it didn't work since it not matches my code.Do you have any answer to me?Thank you for the assistance, Y. D.