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.
 
 
 
 

25 lines
508 B

<?
$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;
?>