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

Re: Php and OpenLDAP: "attribute type undefined" error



You've done:

>     $r=ldap_add($ds,"dc=company, dc=com", $info); // $info

The second value must be the DN to add and you shouldn't have that in the
attribute type list. Change your code, removing the line

>     $info["dn"]="uid=name.lastname, ou=subcarpeta1, dc=company, dc=com";

because there is no attribute type named `DN', and perform the ldap_add like this:

     $r=ldap_add($ds,"uid=name.lastname, ou=subcarpeta1, dc=company, dc=com", $info);

Regards,
	-JP



On Thu, 13 Jun 2002, Jon Zubiarrain wrote:

> I've been trying to use a PHP 4.2 script to add LDAP entries (I'm using
> OpenLDAP 2.0.23). To do so, I used a simple PHP script example as reference
> but I just can't find the way to make it work since I keep getting a "dn:
> attribute type undefined" error.
...
>     // preparamos los datos
>     $info["dn"]="uid=name.lastname, ou=subcarpeta1, dc=company, dc=com";
...
>     // añadimos los datos al directorio
>
>     $r=ldap_add($ds,"dc=company, dc=com", $info); // $info