PHP Code Snippet Library

 +library
+ Arrays (5)
+ COM for Windows (2)
+ ClibPDF (1)
+ Image (7)
+ LDAP (9)
+ Add entry to LDAP
+ Bind to LDAP directory
+ Connect to an LDAP server
+ Generating and catching an error
+ Get Attributes
+ Get Values
+ LDAP Search Example
+ Password Check
+ Search
+ MySQL (12)
+ Regular Expressions (3)
+ String Manipulation (12)
+ Time and Date (6)
 +Snippet Options
+   Printer Friendly
 +General Options
+   Library Home
+   PHP-CSL Credits
+   PHP-CSL License
+   PHP Resource Links
+   Log in
Syntax for: LDAP / Generating and catching an error
<?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"]);
?>
 
Description for: LDAP / Generating and catching an error
No description available...

 
Powered by: PHP Code Snippet Library V0.8