You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

reserveToList.php 479B

12345678910111213141516171819
  1. <?php
  2. $reserve = $_POST['reserve'];
  3. $doc = new DOMDocument;
  4. $doc->load('../db/links.xml');
  5. $xpath = new DOMXpath($doc);
  6. // Buffering and deleting moved element
  7. foreach($xpath->query('reserve/link[title = "'.$reserve.'"]') as $node) {
  8. $buffer = $node;
  9. $node->parentNode->removeChild($node);
  10. }
  11. $searchLabel = $xpath->query('label');
  12. $lastLabel = $searchLabel->length -1;
  13. $searchLabel->item($lastLabel)->appendChild($buffer);
  14. $doc->save('../db/links.xml');