Проблем с изтриване на фтп потребител

pronto

Registered
ето го и кода
Код:
if($_GET["delu"]==on){
echo'<div style="background: #ffffff;">';
$rdeluser=mysql_query("SELECT * FROM `ftpuser` WHERE `ftp`='$_GET[udel]' and username='$_SESSION[username]' and active='1'");
if(mysql_num_rows($rdeluser) == 1){
$rdu=mysql_fetch_array($rdeluser);
$doc = new DOMDocument; 
$doc->load('D:/xampp/FileZillaFTP/FileZilla Server.xml');

$thedocument = $doc->documentElement;

//this gives you a list of the messages
$list = $thedocument->getElementsByTagName('User');

//figure out which ones you want -- assign it to a variable (ie: $nodeToRemove )
$nodeToRemove = null;
foreach ($list as $domElement){
  $attrValue = $domElement->getAttribute('name');
  if ($attrValue == $_GET[udel]) {
    $nodeToRemove = $domElement; //will only remember last one- but this is just an example :)
  }
}

//Now remove it.
if ($nodeToRemove != null)
$thedocument->removeChild($nodeToRemove);
$doc->saveXML(); 
$reloadud=passthru('"'.$fileloc.'FileZilla server.exe' . '"' . '/reload-config');
$fudel = mysql_query("UPDATE ftpuser SET active='0' where ftp='$_GET[udel]' and username='$_SESSION[username]'") or die(mysql_error());
}else{echo"<center><font color=red>Този потребител не е направен от теб</font>";}
echo"</div>";
}



скрипта не маха потребителя от хмл файла

проблема според мен идва от този ред
$attrValue = $domElement->getAttribute('name');
защото в хмл фаила name e Name
но когато го направя
$attrValue = $domElement->getAttribute('Name');

ми дава следната грешка



Fatal error: Uncaught exception 'DOMException' with message 'Not Found Error' in D:\xampp\htdocs\cpmodules\ftp.php:129 Stack trace: #0 D:\xampp\htdocs\cpmodules\ftp.php(129): DOMNode->removeChild(Object(DOMElement)) #1 D:\xampp\htdocs\index.php(22): include('D:\xampp\htdocs...') #2 {main} thrown in D:\xampp\htdocs\cpmodules\ftp.php on line 129


някакви идей как да го оправя?


някои ако има готов работещ пхп скрипт и го сподели ще сам му благодарен
 

Back
Горе