What is LDAP and how does it relate to PHP? If you're unsure, then Dannie's come to save the day! In this article he explains what LDAP is and shows you how to create an LDAP address book with PHP...
//Loop Through and Create SELECT OPTIONs for($i=0; $i echo "<OPTION VALUE=\"$i\">".$LDAP_NAME[$i]." </OPTION>";
echo "</SELECT><BR>"; echo "Search for: <INPUT TYPE=\"text\" NAME=\"common\">"; echo "<INPUT TYPE=\"submit\" NAME=\"lookup\" VALUE=\"go\"><BR>"; echo "(You can use * for wildcard searches, ex. * Stanley will find all Stanleys) <BR>"; echo "</FORM></CENTER>";
?>
The only portions of this code that is interpreted is $PHP_SELF which is a global constant for the name of the script itself and the loop that creates the SELECT box from our $LDAP_NAME variable.
Echo Results
Now that all of the work has been done, we print out the result set. If no results were returned, a message is given stating the same.