ldap connection problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sbettadpur
    New Member
    • Aug 2007
    • 121

    ldap connection problem

    hello

    i have problem with connecting to LDAP.... it means

    i have user created on server(192.168. 0.35), if i try using user called srinath
    this type error i am receiving...... ....show below
    --------------------------------------------------------------------
    Error.........
    Warning: ldap_bind() [function.ldap-bind]: Unable to bind to server: Invalid credentials in C:\wamp\www\rec ruitmentsolutio n\phpExcelReade r\activedir.php on line 16
    LDAP bind failed...
    ------------------------------------------------------------------------
    if i connected as without user means anonymous
    ---------------------------------------------------------------------------
    connected LDAP bind successful...
    -----------------------------------------------------------------------------

    can anybody tell what is the problem

    here with i am sending my code :[php]<?php
    // LDAP variables
    $ldaphost = "192.168.0. 35"; // your ldap servers
    //$ldapport = 80; // your ldap server's port number
    //ldap_set_option ($con, LDAP_OPT_PROTOC OL_VERSION, 3);
    //ldap_set_option ($con, LDAP_OPT_REFERR ALS, 0);
    // Connecting to LDAP
    $ldapconn = ldap_connect($l daphost)
    or die("Could not connect to $ldaphost");
    if ($ldapconn) {
    echo "connected" ;
    // binding to ldap server
    $ldapbind = ldap_bind($ldap conn,'','');

    // verify binding
    if ($ldapbind) {
    echo "LDAP bind successful...";
    } else {
    echo "LDAP bind failed...";
    }
    }
    ?>[/php]
    Last edited by ronverdonk; Apr 16 '08, 11:00 PM. Reason: enclose code within tags!!
  • ronverdonk
    Recognized Expert Specialist
    • Jul 2006
    • 4259

    #2
    WARNING:

    As a full member of this site, you know by now that you always have to enclose your code within the appropriate code tags!

    So please enclose your posted code in [code] tags (See How to Ask a Question).

    MODERATOR

    Comment

    Working...