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.

addSiteXML.php 507B

123456789101112131415161718192021222324
  1. <?php
  2. $number = $_POST['number'];
  3. $url = $_POST['url'];
  4. $name = $_POST['name'];
  5. $nb = 1;
  6. $xmla = simplexml_load_file('../db/blog_links.xml');
  7. $test = $xmla->note;
  8. $field_count = count($test);
  9. for($i=0;$i<$field_count;$i++){
  10. if($nb <= $test[$i]['id']) $nb = $test[$i]['id']+1;
  11. }
  12. $newnote = $xmla->addChild('link');
  13. $newnote->addChild('name', $name);
  14. $newnote->addChild('number', $number);
  15. $newnote->addChild('url', $url);
  16. $xmla->asXML('../db/blog_links.xml');
  17. echo $nb;