ray Mon Dec 2 10:13:07 2002 EDT Modified files: /phpdoc/en/reference/ldap/functions ldap-connect.xml Log: Added 2 examples demonstrating ldap-connect. Index: phpdoc/en/reference/ldap/functions/ldap-connect.xml diff -u phpdoc/en/reference/ldap/functions/ldap-connect.xml:1.2 phpdoc/en/reference/ldap/functions/ldap-connect.xml:1.3 --- phpdoc/en/reference/ldap/functions/ldap-connect.xml:1.2 Wed Apr 17 02:39:43 2002 +++ phpdoc/en/reference/ldap/functions/ldap-connect.xml Mon Dec 2 10:13:07 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-connect"> <refnamediv> @@ -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>
-- PHP Documentation Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php