PhpDig.net

What is PhpDig?
PhpDig is a PHP MySQL based
Web Spider & Search Engine.




ldap_search

Name

ldap_search — Recursively searches a directory.

Synopsis

int ldap_search(connectionID, base, filter[, attributes][, attronly][, sizelimit][, timelimit][, dereference]);
int connectionID: Connection ID, either a host or array of hosts
resource base: Base distinguished name to use in the search
string filter: Search filter conforming to RFC 1960 and/or 2254
array attributes (optional): Attributes to be returned
int attronly (optional): Whether to return only attribute names
int sizelimit (optional): Maximum number of entries to be returned
int timelimit (optional): Maximum number of seconds to run the search
int dereference (optional): Whether to dereference (not follow references) in the search

Returns

Result ID; FALSE on error

Description

Performs a search on an LDAP directory using the specified filter, with a scope of the entire subtree of the base distinguished name (DN). The optional arguments control searching parameters. If no match is found, the function returns FALSE. If your base is this:"dc=foo,dc=com" the function would search these entries:"ou=vendors,dc=foo,dc=com","sn=123456789,type=printers, ou=machines, department=marketing,dc=foo,dc=com"

and so on.

Version

PHP Version: 3+, 4+

Example

Example 656. Search a directory for *smith*

$filter = "smith";
$result = ldap_search($ldapconn, "dc=foo,dc=com", "cn=*$filter*");



PHP Functions Essential Reference. Copyright © 2002 by New Riders Publishing (Authors: Zak Greant, Graeme Merrall, Torben Wilson, Brett Michlitsch). This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, v1.0 or later (the latest version is presently available at http://www.opencontent.org/openpub/). The authors of this book have elected not to choose any options under the OPL. This online book was obtained from http://www.fooassociates.com/phpfer/ and is designed to provide information about the PHP programming language, focusing on PHP version 4.0.4 for the most part. The information is provided on an as-is basis, and no warranty or fitness is implied. All persons and entities shall have neither liability nor responsibility to any person or entity with respect to any loss or damage arising from the information contained in this book.

Powered by: vBulletin Version 3.0.7
Copyright ©2000 - 2005, Jelsoft Enterprises Ltd.
Copyright © 2001 - 2005, ThinkDing LLC. All Rights Reserved.