Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


problem with LDAP functions in PHP

archamonarchamon Member Posts: 1

I've been trying some LDAP functions in PHP and am stuck at trying to bind to the LDAP server.


basically i've successfully queried using some LDAP functions when it comes to querying a single server but when I try to do it via an array, i get errors that say "unable to bind to server".

eg. of my script:

this works:

if ($ds) {
$r=ldap_bind($ds, "john", "h92de" );

this doesn't work:

$servers = array("afd-s-31","afd-s-33");

for ($i=0;$i";

The error occurs on the line with ldap_bind().


another thing when i do a search filter, i get this error message:
LDAP: Unable to perform the search: Bad search filter

$dn = "OU=User Accounts,OU=User Directory,DC=xyz,DC=com";

$sr=ldap_search($ds, $dn, $filter);

can anyone spot anything wrong with my LDAP search filters?

thanks for any help.


  • Chris BrownChris Brown USAMember Posts: 4,624 ✭✭

    ________ ( ) free video tutorials and ebooks about || C#, MATLAB, Visual Basic .NET, Go, Assembly, Delphi, Ruby, Scratch, C, Swift, C++, PHP, Visual Basic, Objective-C, Python, R, Java, JavaScript, PL/SQL, Perl Alice, Scala, Crystal, FoxPro, Clojure, Rust, Apex, COBOL, Hack, Fortran, Lua, Ada, Awk, Transact-SQL, Erlang, Prolog, ML, F#, Lisp, VBScript, Scheme, LabVIEW, Dart, Logo, Kotlin, D, ABAP, SAS, Bash, Julia || ______________

Sign In or Register to comment.