Accueil/modules/links/ajax/listToReserve.php

18 lines
429 B
PHP
Raw Normal View History

2010-09-23 15:02:42 +02:00
<?
$reserve = $_POST['reserve'];
$doc = new DOMDocument;
$doc->load('../db/links.xml');
$xpath = new DOMXpath($doc);
// Buffering and deleting moved element
foreach($xpath->query('label/link[title = "'.$reserve.'"]') as $node) {
$buffer = $node;
$node->parentNode->removeChild($node);
}
$searchLabel = $xpath->query('reserve');
$searchLabel->item(0)->appendChild($buffer);
$doc->save('../db/links.xml');