Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

LDAP PHP errors. Can I get a hand?

Status
Not open for further replies.

ReckittBenckiser

Programmer
Joined
Dec 29, 2008
Messages
1
Location
GB
Hi all. I've never really used LDAP before, but I'd like to be able to get PHP to commune with ActiveDirectory using LDAP as the medium. Here is the code I'm using:

Code:
<?php

$con = ldap_connect("ldap://ALPHA.RB.NET");

if($con)
{
  $bind = ldap_bind($con);
  
  $dn = "DC=alpha,DC=rb,DC=net";
  
  $filter = "(cn=*)";
  $search = array("displayname", 1);
  
  $result = ldap_search($con, $dn, $filter, $search);
}
else
{
  echo "Couldnt connect <br>";
}

?>

I'm getting "Warning: ldap_search() [function.ldap-search]: Search: Operations error in G:\inetpub\ on line 14" as an error when I attempt to execute this script.

Any *pointers (pun intended)? lol
 
If you mean to search "the" attribute, it is "ell" not "one".
>$search = array("displayname", 1);
[tt]$search = array("displayname", [red]"l"[/red]);[/tt]
 
Hi There

I found this for you - see if it helps




Regards
Krystian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top