ray             Sun Dec  8 22:27:15 2002 EDT

  Modified files:              
    /phpdoc/en/reference/ldap/functions ldap-bind.xml 
  Log:
  Added 2 examples demonstrating ldap_bind.
  
  
Index: phpdoc/en/reference/ldap/functions/ldap-bind.xml
diff -u phpdoc/en/reference/ldap/functions/ldap-bind.xml:1.2 
phpdoc/en/reference/ldap/functions/ldap-bind.xml:1.3
--- phpdoc/en/reference/ldap/functions/ldap-bind.xml:1.2        Wed Apr 17 02:39:42 
2002
+++ phpdoc/en/reference/ldap/functions/ldap-bind.xml    Sun Dec  8 22:27:15 2002
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.2 $ -->
+<!-- $Revision: 1.3 $ -->
 <!-- splitted from ./en/functions/ldap.xml, last change in rev 1.2 -->
   <refentry id="function.ldap-bind">
    <refnamediv>
@@ -23,6 +23,63 @@
      <parameter>bind_password</parameter> are optional. If not
      specified, anonymous bind is attempted.
     </para>
+    <example>
+     <title>Using LDAP Bind</title> 
+     <programlisting role="php">
+<![CDATA[
+<?php
+
+// using ldap bind
+$ldaprdn  = 'uname';     // ldap rdn or dn
+$ldappass = 'password';  // associated password
+
+// connect to ldap server
+$ldapconn = ldap_connect( "ldap.example.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...";
+}
+
+?>
+]]>
+     </programlisting>
+    </example>
+    <example>
+     <title>Using LDAP Bind Anonymously</title>
+     <programlisting role="php">
+<![CDATA[
+<?php
+
+//using ldap bind anonymously
+
+// connect to ldap server
+$ldapconn = ldap_connect( "ldap.example.com" )
+          or die( "Could not connect to LDAP server." );
+
+if( $ldapconn )
+{
+    // binding anonymously
+    $ldapbind = ldap_bind( $ldapconn );
+
+    if( $ldapbind )
+        echo "LDAP bind anonymous successful...";
+    else
+        echo "LDAP bind anonymous failed...";
+    }
+    
+?>
+]]>
+     </programlisting>
+    </example>
    </refsect1>
   </refentry>
 



-- 
PHP Documentation Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to