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

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

« previous php.doc (#969350241) next »