Ldap_add() : Invalid Syntax
- by Suezy
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?