title: PHP ldap_list() Bad search filter
body: <p>I'm trying to list my Active Directory users using PHP ldap_list() function. I get the following errors when I execute the php code.</p>
  
  <p><code>LDAP bind successful... Warning: ldap_list(): Search: Bad search filter in /var/www/html/ldapn.php on line 29</code></p>
  
  <p>Below is my PHP Code:</p>
  
  <pre><code>&lt;?php
  
  // using ldap bind
  $ldaprdn  = 'draven@myserver.com';     // ldap rdn or dn
  $ldappass = 'draven678';  // associated password
  
  // connect to ldap server
  $ldapconn = ldap_connect("dc.myserver.com")
      or die("Could not connect to LDAP server.");
  
  if ($ldapconn) {
  
      // binding to ldap server
      $ldapbind = ldap_bind($ldapconn, $ldaprdn, $ldappass);
  
      // verify binding
      if ($ldapbind) {
          echo "LDAP bind successful...";
      } else {
          echo "LDAP bind failed...";
      }
  
      $basedn = "dc=myserver, dc=com";
      $justthese = array("OU_Test");
  
      $sr = ldap_list($ldapconn, $basedn, "OU_Test=*", $justthese);
  
  }
  
  ?&gt;
  </code></pre>
  
  <p>note : OU_Test is an Organizational unit. My requirement is to list all users in that Organizational Unit.</p>
  
  <p>What's wrong with my code? How will I be able to resolve this error?</p>