[Date Prev][Date Next] [Chronological] [Thread] [Top]

problems with PHP search



Hello All,

I'm doing some PHP pages in order to access an LDAP server. I want to
do a search on sn and givenname.
Look at this :
     My filter :
        $filter  ="(sn=*". $sn ."*)";
        $filter .="(givenname=*". $gn ."*)";
     My result :
        If $sn="que" the result is :
           name      = queste
           givenname = thomas
        if $sn="que" AND $gn="mas" the result is :
           name      =
           givenname = thomas

In fact, if I specify two arguments in my filter ($sn and $gn), the
search result miss some results (like the name in this example).

I think that my filter isn't good. Must I do something like this :
$filter  ="&(sn=*". $sn ."*)";
$filter .=&"(givenname=*". $gn ."*)";
(in order to make an "AND" operation).

Thanks for help,
Thomas