ldap_add problems
| From: | Joseph Hoot | Date: | Fri, 06 Oct 2000 22:35:29 +0000 |
| Subject: | ldap_add problems | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-18985@lists.php.net to get a copy of this message | ||
Sorry about not including the code before. here is the correct message
I tried using ldap_add() as per the documentation on php.net. Here is the
code that I'm getting errors in the ldap_add line:
<?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"; }
?>
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 know that
my ldap server is working fine. I am using openldap 2.0.4 and have
configured the ldap database correctly.. does anyone see anything wrong
with the above script?
any help would be great!
Thanks,
Joe