?php / / This example contains an error, which we will catch. $ld = ldap_connect( "localhost"); $bind = ldap_bind($ld); / / syntax error in filter expression (errno 87), / / must be "objectclass=* "to work. $res = @ldap_search($ld, "o=Myorg, c=DE", "objectclass"); if (!$res) {printf("LDAP-Errno: %s br \n", ldap_errno($ld)); printf("LDAP-Error: %s br \n", ldap_error($ld)); die("Argh! br \n");} $info = ldap_get_entries($ld, $res); printf("%d matching entries. br \n", $info["count"]);?
?php / / Cet exemple contient une erreur, que nous allons intercepter. $ld = ldap_connect( "localhost"); $bind = ldap_bind($ld); / / Erreur de syntaxe dans l'expression du filtre (errno 87), / / ce doit être "objectclass=* "$res = @ldap_search($ld, "o=Myorg, c=DE", "objectclass"); if (!$res) {printf("LDAP-Errno: %s br \n", ldap_errno($ld)); printf("LDAP-Error: %s br \n", ldap_error($ld)); die("Argh! br \n");} $info = ldap_get_entries($ld, $res); printf("%d entrées trouvées. br \n", $info["count"]);?