note 106632 rejected from function.ldap-bind by thiago

From: Date: Mon, 28 Nov 2011 11:38:25 +0000
Subject: note 106632 rejected from function.ldap-bind by thiago
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-184707@lists.php.net to get a copy of this message
Note Submitter: jitesh at maximaainfoways dot com ---- Hello PHP Team, I have to bind active directory user with server. i can successfully connect with server but somehow can not bind.i do not know whats the reason. Following is my php source code: <?php $basedn="dc=domain,dc=com"; echo "Connecting ...<br/>"; $ds=ldap_connect("192.XXX.XXX.XX"); // must be a valid LDAP server! echo "connect result is ".$ds."<br/>"; if($ds){ ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3); $lb=ldap_bind($ds,"cn=xyz,o=domain.com","password"); if ($lb) { echo "LDAP bind successful..."; } else { echo "LDAP-Errno: " . ldap_errno($ds) . "<br />"; echo "LDAP-Error: " . ldap_error($ds) . "<br />"; } ldap_close($ds); } ?> can you please give me what exactly i have to pass username parameter in 'ldap_bind' function? source please provide any source code that help me to do so? any help will be great appreciate.. Please help.. :( Thanks Regards Jitesh

« previous php.notes (#184707) next »