// basic sequence with LDAP is connect, bind, search, interpret search // result, close connection
$ds=ldap_connect("localhost"); // must be a valid LDAP server! //echo "connect result is ".$ds."
"; if (empty($query)) { echo "请从下拉式选单中选择欲查询部门"; } else { if ($ds) { // echo "Binding ..."; $r=ldap_bind($ds); // this is an "anonymous" bind, typically // read-only access // echo "Bind result is ".$r."