How can I get control over the result of ldap_bind function
<p>I am working with symfony 2.1 and authenticating with active directory. The thing is that when the parameters of the ldap function are rigth everything is fine, but when user or password are wrongs I get a this: 
<strong>Warning: ldap_bind() [function.ldap-bind]: Unable to bind to server: Invalid credentials in C:\wamp\www\tesis\src\Usuarios\userBundle\Controller\DefaultController.php line 56</strong></p>

<p>This is my code:</p>

<pre><code>   if ($ldapconn){
     if(ldap_bind($ldapconn, $ldapuser, $ldappass)){
            $ldapBase = 'OU=Usuarios UNISS,DC=cuss,DC=suss,DC=co,DC=cu';
            $filter="sAMAccountName=$use";
            $sr = ldap_search($ldapconn, $ldapBase, $filter);
            $ent= ldap_get_entries($ldapconn,$sr);

           ...

            return $this-&gt;render('userBundle:Default:index.html.twig',array('sum' =&gt;$tipo));
   }

    else
         return $this-&gt;render('userBundle:Default:index.html.twig', array("msj" =&gt; "Usuario o Contraseña incorrectos"));
    }
</code></pre>

<p>Before all Thanks for your help</p>
