Voting

: one plus zero?
(Example: nine)

The Note You're Voting On

ben _at_ onshop_co_uk
15 years ago
Example to illustrate searching more than one DN (multiple DNs):

<?php
$ds
=ldap_connect($ldapserver);

$dn[]='OU=ABC,DC=xyz,DC=ac,DC=uk';
$dn[]='OU=DEF,DC=xyz,DC=ac,DC=uk';

$id[] = $ds;
$id[] = $ds;

$filter = 'samaccountname='.$_POST['username'];

$result = ldap_search($id,$dn,$filter);

$search = false;

foreach (
$result as $value) {
if(
ldap_count_entries($ds,$value)>0){
$search = $value;
break;
}
}

if(
$search){
$info = ldap_get_entries($ds, $search);
}else{
$info = 'No results found';
}
?>

<< Back to user notes page

To Top