function del_dhcpsubnet_pools($dhcpsubnetDN)
{
    global $ds, $suffix, $auDN, $ldapError;
    $filter = "(&(objectclass=dhcpPool)(dhcphlpcont={$dhcpsubnetDN}))";
    if (!($result = uniLdapSearch($ds, $auDN, $filter, array("dn", "cn", "dhcprange"), "dn", "sub", 0, 0))) {
        # redirect(5, "", $ldapError, FALSE);
        echo "no search";
        die;
    }
    $result = ldapArraySauber($result);
    #print_r($result);echo "<br>";
    echo "<br>Pools des DHCP Subnets l&ouml;schen:<br>";
    $delentry['dhcphlpcont'] = $dhcpsubnetDN;
    foreach ($result as $item) {
        echo "Pool {$item['cn']}<br>";
        echo "{$item['dn']}<br>";
        delete_dhcppool($item['dn']);
    }
}
<?php

include '../standard_header.inc.php';
$poolDN = $_POST['dn'];
$cn = $_POST['name'];
$subnetaudn = $_POST['subnetaudn'];
$dhcpsrv = $_POST['dhcpsrv'];
$mnr = $_POST['mnr'];
$seconds = 2;
$url = "dhcppools.php?mnr=" . $mnr;
echo "\n<html>\n<head>\n\t<title>Computers Management</title>\n\t<link rel='stylesheet' href='../styles.css' type='text/css'>\n</head>\n<body>\n<table border='0' cellpadding='30' cellspacing='0'> \n<tr><td>";
if ($poolDN != "") {
    if (delete_dhcppool($poolDN)) {
        $mesg = "Pool <b>" . $cn . "</b> erfolgreich gel&ouml;scht!<br><br>";
        update_dhcpmtime($subnetaudn);
    } else {
        $mesg = "Fehler beim l&ouml;schen des Pools <b>" . $cn . "</b> !<br><br>";
    }
}
$mesg .= "<br>Sie werden automatisch auf die vorherige Seite zur&uuml;ckgeleitet. <br>\t\t\t\t\n\t\t\tFalls nicht, klicken Sie hier <a href=" . $url . " style='publink'>back</a>";
redirect($seconds, $url, $mesg, $addSessionId = TRUE);
echo "</td></tr></table></body>\n</html>";