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
422 B

<?// Escaping the input data:
$rid = $_POST['id'];
$explodeid = explode("-",$rid);
$id = intval($explodeid[1]);
$xmla = simplexml_load_file('../db/notes.xml');
$target = false;
$i = 0;
foreach ($xmla->note as $s) {
if ($s['id']==$id) { $target = $i; break; }
$i++;
}
if ($target !== false) {
unset($xmla->note[$target]);
}
$xmla->asXML('../db/notes.xml');
$target++;
echo $target;
?>