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.
19 lines
477 B
19 lines
477 B
<? |
|
$reserve = $_POST['reserve']; |
|
|
|
$doc = new DOMDocument; |
|
$doc->load('../db/links.xml'); |
|
|
|
$xpath = new DOMXpath($doc); |
|
|
|
// Buffering and deleting moved element |
|
foreach($xpath->query('reserve/link[title = "'.$reserve.'"]') as $node) { |
|
$buffer = $node; |
|
$node->parentNode->removeChild($node); |
|
} |
|
|
|
$searchLabel = $xpath->query('label'); |
|
$lastLabel = $searchLabel->length -1; |
|
|
|
$searchLabel->item($lastLabel)->appendChild($buffer); |
|
$doc->save('../db/links.xml'); |