PHP 4完全中文手册 我形我塑相册 家园常用软件下载 我形我塑相册活动专区 给我留言 我形我塑网站首页
我形我塑,网络相册,www.5x54.com 相册 相册 心情相册,少女相册 免费申请,我形我塑免费相册
 PHP 4 完全中文手册   http://www.5x54.com
 

 


函数:ldap_add()


ldap_add

增加 LDAP 名录的条目。

语法: boolean ldap_add(int handle, string dn, array entry);

返回值: 布尔值

函数种类: 网络系统

内容说明

本函数用来加入新的条目到 LDAP 名录之中。参数 handle 为打开 LDAP 的代号。参数 dn 为要加入条目的具体 dn 字符串。参数 entry 为数组,为个体所有的条目,数组的内容是条目的相关信息。若无错误则返回 true 值。

使用范例

<?php
$ds
=ldap_connect("localhost");  // 连上 LDAP 服务器
if ($ds) {
  
// 系住恰当的 dn
  
$r=ldap_bind($ds,"cn=root, o=A2Z Company, c=TW""secret");
  
// 预先准备好新条目的资料
  
$info["cn"]="Wilson Peng";
  
$info["sn"]="Peng";
  
$info["mail"]="wilson@wilson.gs";
  
$info["objectclass"]="person";
  
// 加入新条目
  
$r=ldap_add($ds"cn=Wilson Peng, o=A2Z Company, c=TW"$info);
  
ldap_close($ds);
} else {
  echo 
"抱歉,无法连上 LDAP 服务器。"
}
?>


[ 上一页 下一页 ]