User Guide

260 Developing Web Applications with ColdFusion
<!--- Use CFLDAP to retrieve the common
name and distinguished name for all employees
that have a surname that contains ens and a common
name that is > K. Search starts in the country US
and organization Ace Industry.--->
<CFLDAP Name="EntryList"
SERVER="myserver"
ACTION="Query"
ATTRIBUTES="dn,cn, sn"
SCOPE="SUBTREE"
SORT="sn ASC"
FILTER="(&(sn=*ens*)(cn>=K))"
START="o=Ace Industry, c=US"
MAXROWS=50
TIMEOUT=30>
<HTML>
<HEAD>
<TITLE>LDAP Directory Example</TITLE>
</HEAD>
<P>To modify the attributes of an entry,
select the entry and click the <B>Update</B>
button. To create a new entry, click the
<B>Add</B> button.
<CFFORM NAME="MyForm"
ACTION="ldap_update.cfm"
TARGET="Lower">
<CFSELECT NAME="dn"
SIZE="5"
REQUIRED="Yes"
QUERY="EntryList"
Value="dn"
Display="cn">
</CFSELECT>
<INPUT TYPE="Submit" VALUE="Update...">
</CFFORM>
<FORM ACTION="ldap_add.cfm"
METHOD="Post"
TARGET="Lower">
<INPUT TYPE="Submit" VALUE="Add...">
</FORM>
</BODY>
</HTML>
3. Change myserver to a valid LDAP server.