cvs: phpdoc /en/reference/ldap/functions ldap-connect.xml

From: Date: Mon, 02 Dec 2002 15:13:07 +0000
Subject: cvs: phpdoc /en/reference/ldap/functions ldap-connect.xml
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969350100@lists.php.net to get a copy of this message
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>

« previous php.doc (#969350100) next »