"; if ($ds) { echo "Binding ..."; $r=ldap_bind($ds); // this is an "anonymous" bind, typically // read-only access echo "Bind result is ".$r."
"; echo "Searching for (sn=S*) ..."; // Search surname entry $sr=ldap_search($ds,"o=My Company, c=US", "sn=S*"); echo "Search result is ".$sr."
"; echo "Number of entires returned is ".ldap_count_entries($ds,$sr)."
"; echo "Getting entries ...
"; $info = ldap_get_entries($ds, $sr); echo "Data for ".$info["count"]." items returned:
";
for ($i=0; $i<$info["count"]; $i++) {
echo "dn is: ". $info[$i]["dn"] ."
";
echo "first cn entry is: ". $info[$i]["cn"][0] ."
";
echo "first email entry is: ". $info[$i]["mail"][0] ."
"; } echo "Closing connection"; ldap_close($ds); } else { echo "