Page 1 of 1

LDAP_SEARCH got error

PostPosted: 29. March 2006 20:24
by OXODesign
Hello, I trying LDAP from XAMPP but I got a error when I use the function LDAP_SEARCH.

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.

PostPosted: 29. March 2006 22:27
by Wiedmann
You have read the user contributed notes for that function?

PostPosted: 30. March 2006 16:10
by OXODesign
Wiedmann wrote:You have read the user contributed notes for that function?
What do you mean with that? I'm not so good in English! Do you mean this: http://no.php.net/ldap_search ?

PostPosted: 30. March 2006 16:14
by Wiedmann