note 94554 added to function.ldap-search
| From: | ben_at_onshop_co_uk at osu1 dot php dot net | Date: | Wed, 11 Nov 2009 18:24:39 +0000 |
| Subject: | note 94554 added to function.ldap-search | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-162775@lists.php.net to get a copy of this message | ||
Example to illustrate searching more than one DN (multiple DNs):
$ds=ldap_connect($ldapserver);
$dn[]='OU=ABC,DC=xyz,DC=ac,DC=uk';
$dn[]='OU=DEF,DC=xyz,DC=ac,DC=uk';
$id[] = $ds;
$id[] = $ds;
$filter = 'samaccountname='.$_POST['username'];
$result = ldap_search($id,$dn,$filter);
$search = false;
foreach ($result as $value) {
if(ldap_count_entries($ds,$value)>0){
$search = $value;
break;
}
}
if($search){
$info = ldap_get_entries($ds, $search);
}else{
$info = 'No results found';
}
----
Server IP: 69.147.83.197
Probable Submitter: 137.73.37.15
----
Manual Page -- http://www.php.net/manual/en/function.ldap-search.php
Edit -- https://master.php.net/note/edit/94554
Del: integrated -- https://master.php.net/note/delete/94554/integrated
Del: useless -- https://master.php.net/note/delete/94554/useless
Del: bad code -- https://master.php.net/note/delete/94554/bad+code
Del: spam -- https://master.php.net/note/delete/94554/spam
Del: non-english -- https://master.php.net/note/delete/94554/non-english
Del: in docs -- https://master.php.net/note/delete/94554/in+docs
Del: other reasons-- https://master.php.net/note/delete/94554
Reject -- https://master.php.net/note/reject/94554
Search -- https://master.php.net/manage/user-notes.php