ldap_list.php3
来自「linux操作系统中 php 核心编程所有例程 都是一些很不错的案例」· PHP3 代码 · 共 46 行
PHP3
46 行
<HTML>
<HEAD>
<TITLE>ldap_list</TITLE>
</HEAD>
<BODY>
<?
// connect to LDAP server
$ldap=ldap_connect("ldap.itd.umich.edu");
if($ldap)
{
// list organizations in the US
$dn = "c=US";
$attributes = array("o");
$filter = "o=*";
// perform search
$result = ldap_list($ldap, $dn,
$filter, $attributes);
if($result)
{
$entries = ldap_get_entries($ds, $sr);
for($index = 0;
$index < $entries["count"]; $index++)
{
print($entries[$index]["o"][0]);
}
ldap_free_result($result);
}
else
{
print("Nothing found");
}
// close connection
ldap_close($ldap);
}
else
{
echo "<B>Connection failed!</B>";
}
?>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?