<!---  This example shows the use of CFLDAP --->
<HTML>
<HEAD>
<TITLE>CFLDAP Example</TITLE>
</HEAD>

<BASEFONT FACE="Arial, Helvetica" SIZE=2>
<BODY  bgcolor="#FFFFD5">

<H3>CFLDAP Example</H3>

<P>CFLDAP provides an interface to LDAP 
(Lightweight Directory Access Protocol) directory
servers like BigFoot (<a href="http://www.bigfoot.com">http://www.bigfoot.com</A> and Four11 (<a href="http://www.four11.com">http://www.four11.com</A>).

<P>Enter a name (try your own name) and search a public
LDAP resource.

<FORM ACTION="cfldap.cfm" METHOD="POST">
<TABLE BORDER=0 CELLSPACING=2 CELLPADDING=2>
<TR>
 <TH ALIGN="RIGHT">Name:</TH>
 <TD><INPUT TYPE="text" NAME="name"></TD>
</TR>
<TR>
 <TH ALIGN="RIGHT">Server:</TH>
 <TD>
  <SELECT NAME="server">
   	<OPTION VALUE="Four11">Four11
  </SELECT>
 </TD>
</TR>
<TR>
 <TH COLSPAN=2><INPUT TYPE="submit" VALUE="Search"></TH>
</TR>
</TABLE>
</FORM>

<!--- If the server has been defined, run the query --->
<CFIF IsDefined("form.server")>
<!--- check to see that there is a name listed --->
<CFIF form.name is not "">
<!--- make the LDAP query --->
<CFLDAP
 SERVER="ldap.four11.com"
 ACTION="QUERY"
 NAME="results"
 START="cn=#name#,c=US"
 FILTER="(cn=#name#)"
 ATTRIBUTES="cn,o,l,st,c,mail,telephonenumber"
 SORT="cn ASC">

<!--- Display results --->
	<CENTER>
	<TABLE BORDER=0 CELLSPACING=2 CELLPADDING=2>
	 <TR>
		  <TH COLSPAN=5><CFOUTPUT>#results.RecordCount# matches found</CFOUTPUT></TH>
	 </TR>
	 <TR>
		  <TH><FONT SIZE="-2">Name</FONT></TH>
		  <TH><FONT SIZE="-2">Organization</FONT></TH>
		  <TH><FONT SIZE="-2">Location</FONT></TH>
		  <TH><FONT SIZE="-2">E-Mail</FONT></TH>
		  <TH><FONT SIZE="-2">Phone</FONT></TH>
	 </TR>
	<CFOUTPUT QUERY="results">
	 <TR>
		  <TD><FONT SIZE="-2">#cn#</FONT></TD>
		  <TD><FONT SIZE="-2">#o#</FONT></TD>
		  <TD><FONT SIZE="-2">#l#, #st#, #c#</FONT></TD>
		  <TD><FONT SIZE="-2"><A HREF="mailto:#mail#">#mail#</A></FONT></TD>
		  <TD><FONT SIZE="-2">#telephonenumber#</FONT></TD>
	 </TR>
	</CFOUTPUT>
	</TABLE>
	</CENTER>
</CFIF>
</CFIF>

</BODY>
</HTML>       
