Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
通过php打开DS更新_Php_Linux_Opends - Fatal编程技术网

通过php打开DS更新

通过php打开DS更新,php,linux,opends,Php,Linux,Opends,我有一个问题我已经在centos服务器上安装了OpenDS我想通过网页在OpenDS服务器上保存一些数据我会使用php/mysql任何人对此都有想法吗 提前谢谢 罗山 <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" > </head> <body> <?php $ldapconfig['host'] = 'PC100'

我有一个问题我已经在centos服务器上安装了OpenDS我想通过网页在OpenDS服务器上保存一些数据我会使用php/mysql任何人对此都有想法吗

提前谢谢 罗山


<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
</head>
<body>
<?php
$ldapconfig['host'] = 'PC100';
$ldapconfig['port'] = 1389;
$ldapconfig['basedn'] = 'dc=company,dc=com';

$ds=ldap_connect($ldapconfig['host'], $ldapconfig['port']);

$password=1;
$username="cn=Directory Manager";


if ($bind=ldap_bind($ds, $username, $password)) {
  echo("Login correct");

ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3); // IMPORTANT
 $dn = "cn=Directory Managerk,dc=example,dc=com"; 


    //$ldaprecord['cn'] = "opp";
    $ldaprecord['givenName'] = "mkljl";
    $ldaprecord['sn'] = "roshan";
    $ldaprecord['objectclass'][0] = "inetOrgPerson";    
    $ldaprecord['objectclass'][1] = "test";
    $ldaprecord['mail'] = "lkl@fh.com";
    //$encode=utf8_encode("වවවවවවවවවවව");
    //die(print_r(utf8_decode($encode)));
    $ldaprecord['attr'] ="වවවවවවවවවවව";





    // add data to directory
    $r = ldap_add($ds, $dn, $ldaprecord);

   // $r= ldap_modify($ds, $dn, $ldaprecord);

} else {

  echo("Unable to bind to server.</br>");


}
?>

</body>
</html>