Ldap_add() : Invalid Syntax

Posted by Suezy on Stack Overflow See other posts from Stack Overflow or by Suezy
Published on 2009-07-10T06:11:37Z Indexed on 2010/04/03 1:03 UTC
Read the original article Hit count: 311

Filed under:
|

I have a program here that uses the ldap_add, when i try to run the program, it displays an error:

Warning: ldap_add() [function.ldap-add]: Add: Invalid syntax in /var/www/suey/costcenter.20090617.php on line 780

My lil' code here is:

 $ldapservers='ourServer';
 $ds = ldap_connect($ldapservers);
 if ($ds){
           $r = ldap_bind($ds, $ldaprootun, $ldaprootpw);
           $add = ldap_add($ds, "uid=$fuid, $ldapbasedn", $infonew);

  }

ldapbasedn is set to o=ourGroup; infonew is an array of entries (person information) and am so sure that the array is not empty because i already tested it. the uid is not empty too. What could be wrong? Is it the entries(array)? or the server am trying to connect to? I tried testing the ldap_bind, and it also works well too..hmmm..

Pls help.. thanks!


I found the problem.. it's in the index infonew["createdBy"] = getenv("REMOTE_USER"); it returns NULL! now, is that right?

© Stack Overflow or respective owner

Related posts about ldap

Related posts about php