php man page for ldap_bind

Query: ldap_bind

OS: php

Section: 3

Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar

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_sasl_bind(3) - redhat
ldap_bind_s(3) - redhat
ldap_bind(3) - redhat
net::ldap::extension::whoami(3) - suse
net::ldap::extension::whoami(3) - osx
Similar Topics in the Unix Linux Community
Link Directory to directory (S.O.S)
LDAP client config.
LDAP problems
ldap recovery
Script to check if user can bind, then output to file