Added 2 examples demonstrating ldap-connect.

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@106565 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Ray Hunter 2002-12-02 15:13:07 +00:00
parent 6d2a53fa7b
commit 3d86b45dc2

View file

@ -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>