通过php打开DS更新
我有一个问题我已经在centos服务器上安装了OpenDS我想通过网页在OpenDS服务器上保存一些数据我会使用php/mysql任何人对此都有想法吗 提前谢谢 罗山通过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'
<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>