";
echo "Connecting ...";
$ds=ldap_connect("localhost"); // must be a valid LDAP server!
echo "connect result is " . $ds . " ";
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, "dc=intranet,dc=xpression,dc=sk", "uid=kjurica");
echo "Search result is " . $sr . " ";
echo "Number of entires returned is " . ldap_count_entries($ds, $sr) . " ";
echo "Getting entries ...