ldap_bind(3) php man page | unix.com

Man Page: ldap_bind

Operating Environment: php

Section: 3

LDAP_BIND(3)								 1							      LDAP_BIND(3)

ldap_bind - Bind to LDAP directory

SYNOPSIS
bool ldap_bind NULL NULL (resource $link_identifier, [string $bind_rdn], [string $bind_password])
DESCRIPTION
Binds to the LDAP directory with specified RDN and password.
PARAMETERS
o $link_identifier - An LDAP link identifier, returned by ldap_connect(3). o $bind_rdn - o $bind_password - If $bind_rdn and $bind_password are not specified, an anonymous bind is attempted.
RETURN VALUES
Returns TRUE on success or FALSE on failure.
EXAMPLES
Example #1 Using LDAP Bind <?php // using ldap bind $ldaprdn = 'uname'; // ldap rdn or dn $ldappass = 'password'; // associated password // connect to ldap server $ldapconn = ldap_connect("ldap.example.com") or die("Could not connect to LDAP server."); if ($ldapconn) { // binding to ldap server $ldapbind = ldap_bind($ldapconn, $ldaprdn, $ldappass); // verify binding if ($ldapbind) { echo "LDAP bind successful..."; } else { echo "LDAP bind failed..."; } } ?> Example #2 Using LDAP Bind Anonymously <?php //using ldap bind anonymously // connect to ldap server $ldapconn = ldap_connect("ldap.example.com") or die("Could not connect to LDAP server."); if ($ldapconn) { // binding anonymously $ldapbind = ldap_bind($ldapconn); if ($ldapbind) { echo "LDAP bind anonymous successful..."; } else { echo "LDAP bind anonymous failed..."; } } ?>
SEE ALSO
ldap_unbind(3). PHP Documentation Group LDAP_BIND(3)
Related Man Pages
ldap_bind_s(3) - redhat
ldap_kerberos_bind1_s(3) - redhat
net::ldap::extension::whoami(3) - mojave
net::ldap::extension::whoami(3) - centos
ldap_connect(3) - php
Similar Topics in the Unix Linux Community
ldap bind error
LDAP client config.
ldap recovery
Bind keys using unix
How to pass user credentials between apps on the same server?