In PHP, how can you bind using a property other than the default cn? (I'm not asking how to validate a user account using LDAP search queries, I'm specifically asking how I can bind using a sAMAaccountname and password in PHP).
In Perl, this is possible by specifying the property to query directly on the LDAP string:
Connect simply opens the connection it doesn't set any credentials on the connection. Once the connection is open you bind it to a set of credentials using ldap_bind.
In connecting to AD you can use 3 different formats for the username.