Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_php thread: ldap_modify from chapter 13


Message #1 by "berry" <kurank@l...> on Wed, 7 Nov 2001 03:53:00
i had tried a sample code from professional php programming book (chapter 
13). After a few modification i been able to do search and add to my 
address directory. But still i have a problem to modify it. Can anybody 
help? 
TQ.

  $dnString = "uid=" . $uid . "," . $baseDN;

   $newEntry["dn"]              = $dnString;
   $newEntry["cn"]              = $cn;
   $newEntry["sn"]              = $sn;
   $newEntry["telephonenumber"] = $telephonenumber;

   $linkIdentifier = ConnectBindServer();
   if ($linkIdentifier) {
      if ((ldap_modify($linkIdentifier, $dnString, $newEntry)) == false) {
         DisplayErrMsg("LDAP directory modification failed !!");
         CloseConnection($linkIdentifier);
         exit;
      } 
      else {
         GenerateHTMLHeader("The entry was modified succesfully");
         ReturnToMain();
      }
   } else {
      DisplayErrMsg("Connection to LDAP server failed");
      exit;
   }

  Return to Index