Re: ldap_add problems
| From: | Jani Taskinen | Date: | Fri, 06 Oct 2000 22:03:07 +0000 |
| Subject: | Re: ldap_add problems | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-18994@lists.php.net to get a copy of this message | ||
On Fri, 6 Oct 2000, Joseph Hoot wrote:
><?php $connection=ldap_connect("ldap.nowcomwan.com");
>
>if ($connection) {
>
>$bind=ldap_bind($connection,"cn=manager,dc=nowcom,dc=com","nowtech");
>
> // prepare data
> $info["cn"]="John Jones";
> $info["sn"]="Jones";
> $info["mail"]="Jones@test.com";
> $info["objectclass"]="person";
>
> // add data to directory
> ldap_add($connection, "cn=John Jones,dc=nowcom,dc=com", $info);
> ldap_close($connection);
>
>} else {
> echo "Unable to connect to LDAP Server"; }
>
>?>
Try adding this line after ladp_add-line:
echo ldap_error($connection);
And you'll see whether ldap_add() was success or if not, what error
it gives.
>I had a much more robust $info before I tried this very simple one and
>every time I get
>
>Warning: LDAP: add operation could not be completed. in
>/home/httpd/html/ldapadmin/scripts/adduser.scp.php on line 14
I bet you are having same problem as I was when I tried this
example of yours..there already was an entry with that dn.
--Jani