你的<?怎么会在下面??<?
$ds=ldap_connect("192.168.7.2"); // 连上 LDAP 服务器
if ($ds) {
// 系住恰当的 dn
$r=ldap_bind($ds,"cn=root, o=CA, c=US", "123456");
if($r) echo "bind ok!\n";
// 预先准备好新条目的资料
$info["cn"]="Wilson Peng";
$info["sn"]="Peng";
$info["mail"]="[email protected]";
$info["objectclass"]="person";
// 加入新条目
$r=ldap_add($ds,"cn=Wilson Peng, o=CA, c=US", $info);
ldap_close($ds);
} else {
echo "抱歉,无法连上 LDAP 服务器。";
}
?>
$ds=ldap_connect("192.168.7.2"); // 连上 LDAP 服务器
if ($ds) {
// 系住恰当的 dn
$r=ldap_bind($ds,"cn=root, o=CA, c=US", "123456");
if($r) echo "bind ok!\n";
// 预先准备好新条目的资料
$info["cn"]="Wilson Peng";
$info["sn"]="Peng";
$info["mail"]="[email protected]";
$info["objectclass"]="person";
// 加入新条目
$r=ldap_add($ds,"cn=Wilson Peng, o=CA, c=US", $info);
ldap_close($ds);
} else {
echo "抱歉,无法连上 LDAP 服务器。";
}
?>
Netscape http://developer.netscape.com/tech/directory/
密西根大学 http://www.umich.edu/~dirsvcs/ldap/index.html
OpenLDAP 计划 http://www.openldap.com
LDAP World http://elvira.innosoft.com/ldapworld