[PHP-DOC] LDAP Examples From: Ray Hunter (bigdog <email protected>)
Date: 11/21/02

I would like to add a bunch of examples to the LDAP extension functions.

Could everyone give me some feedback if this is the correct way?

Here is my first attempt.

Index: ldap-connect.xml
===================================================================
RCS file:
/repository/phpdoc/en/reference/ldap/functions/ldap-connect.xml,v
retrieving revision 1.2
diff -u -r1.2 ldap-connect.xml
--- ldap-connect.xml 17 Apr 2002 06:39:43 -0000 1.2
+++ ldap-connect.xml 21 Nov 2002 23:14:34 -0000
@@ -35,6 +35,42 @@
       URL and SSL support were added in 4.0.4.
      </simpara>
     </note>
+ <example>
+ <title>Example of connecting to LDAP server.</title>
+ <programlisting role="php">
+<![CDATA[
+<?php
+
+// LDAP variables
+$ldaphost = 'ldap.example.com'; // your ldap servers
+$ldapport = 389; // your ldap server's port number
+
+// Connecting to LDAP
+$ldapconn = ldap_connect( $ldaphost, $ldapport )
+ or die( "Could not connect to {$ldaphost}" );
+
+?>
+]]>
+ </programlisting>
+ </example>
+ <example>
+ <title>Example of connecting securely to LDAP server.</title>
+ <programlisting role="php">
+<![CDATA[
+<?php
+
+// make sure your host is the correct one
+// that you issued your secure certificate to
+$ldaphost = 'ldaps://ldap.example.com/';
+
+// Connecting to LDAP
+$ldapconn = ldap_connect( $ldaphost )
+ or die( "Could not connect to {$ldaphost}" );
+
+?>
+]]>
+ </programlisting>
+ </example>
    </refsect1>
   </refentry>

-- 

Ray Hunter email: bigdog <email protected> www: http://venticon.com

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