I use the following code to modify an entry on my Exchange server.
But i get an error:
Warning: LDAP: modify operation could not be completed. in D:\ftproot\wwwroot\ldap\write\ldapmodify.php on line 24
any ideas??
kind regards,
Martijn
<?php
$naam = $POST["name"];
$email = $POST["email"];
$bedrijf = $POST["bedrijf"];
$afdeling = $POST["afdeling"];
$telefoonnummer = $POST["telefoonnummer"];
$dn = $POST["dn"];
$ds = "cn=ldapquery, o=ntk501";
print("$dn<br>");
$LDAPServer = "10.40.21.14";
print ("Script to test LDAP connection and search with Exchange Server 5.5<br>");
print ("LDAPServer = $LDAPServer<br>");
//Making connection
$connection = ldap_connect($LDAPServer);
if ($connection)
{
print("Connection result = $connection<br>");
$binding = ldap_bind($connection,$ds,"ldaptest");
if ($binding)
{
print("Binding result = $binding<br>");
$EntryToChange["telephoneNumber"] = $telefoonnummer;
$modify = ldap_modify($connection, $dn, $EntryToChange);
print("$modify<br>");
ldap_close($connection);
}
else
{
print("Binding unsuccessfull error = $binding<br>");
}
}
else
{
print("Connection unsuccesfull error = $connection<br>");
}
?>