The error I got is:
Warning: ldap_search() [function.ldap-search]: Search: Operations error in C:\Program Files\xampp\htdocs\test.php on line 10
Here is the code I use:
- Code: Select all
<?php
$connect = ldap_connect("localhost");
$set = ldap_set_option($connect, LDAP_OPT_PROTOCOL_VERSION, 3);
echo $set;
$dn = "o=MyCompany, c=com";
$filter="(|(sn=f*)(givenname=mav*))";
$justthese = array("ou", "sn", "givenname", "mail");
$sr=ldap_search($connect, $dn, $filter, $justthese);
$info = ldap_get_entries($connect, $sr);
echo $info["count"]." entries returned\n";
?>
In this case I most get all surname with "f" or all givenname with mav.
To Connect and BIND it's working fine, the problem is to search in AD, cold someone make a small exampel with LDAP_SEARCH and posted here.
I have a Windows 2003 SERVER (AD).
Thanx for help for last time, and I hope someone can help me again.