ldap_bind

bool ldap_bind(resource connectionID, [string RDN], [string password]) 
connectionID Connection ID
RDN Relative distinguished name (RDN) used for operations
password Password of the relative distinguished name

Binds to perform operations.

Returns:

TRUE on success; FALSE on failure

Description:

ldap_bind() binds to an LDAP directory with an optional relative distinguished name (RDN) and password. If the relative distinguished name and password are not specified, an anonymous connection is attempted. Some servers require an arbitrary password even for anonymous binding.

Availability:

UNIX/Linux, Windows

Version:

3+, 4+

Example:

Set up an LDAP connection
 if (!($ldapconn = ldap_connect($host)) { echo "Error! Could not connect to ...

Get PHP Functions Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.