tags:

views:

208

answers:

1

Hi all, I'm trying to connect to my AD server and check if username and password is correct when I'm trying to do that, It always tells me:

Unable to bind to server: Invalid credentials

My code is:

$ldapconn = ldap_connect($adserver,$adport); $ldapbind = @ldap_bind($ldapconn,"$username","$password");

when I tried to set a username with and without domain name in this variations: [email protected] domain\user user

when I trying to bind anonymously, Its ok. Do you have any suggestion here? Thank you very much. regards. Elad.

A: 

Check username. It should be a properly formatted RDN/DN. Special characters must be escaped.

It would help if you post the value of $username.

ZZ Coder
can you give me an example?I don't understand what you meantthank you.
Elad