Accueil/ajax/addSiteXML.php

25 lines
507 B
PHP
Raw Permalink Normal View History

<?php
2010-09-14 23:38:29 +02:00
$number = $_POST['number'];
$url = $_POST['url'];
$name = $_POST['name'];
$nb = 1;
$xmla = simplexml_load_file('../db/blog_links.xml');
$test = $xmla->note;
$field_count = count($test);
for($i=0;$i<$field_count;$i++){
if($nb <= $test[$i]['id']) $nb = $test[$i]['id']+1;
}
$newnote = $xmla->addChild('link');
$newnote->addChild('name', $name);
$newnote->addChild('number', $number);
$newnote->addChild('url', $url);
$xmla->asXML('../db/blog_links.xml');
echo $nb;