How to connect and bind ldap in PHP

Bind LDAP/ AD using php <?php $ldapHost = ‘ldap://alobin.com’; $ldapPort = 387; $ldapRdn = “alobinuser”; $ldapPassword = “@#$<DSFSF”; $ldapIdentifier = ldap_connect($ldapHost, $ldapPort); if($ldapIdentifier) { $bind = @ldap_bind($ldapIdentifier, $ldapRdn, $ldapPassword); if($bind) { echo ‘Ldap binding successfull’; } else { echo ‘Ldap binding failed’; } } else { echo ‘Ldap connection failed.’; }

Continue reading