Sorry about this, but I don't know much about LDAP, and the book I have
doesn't tell me much.
I was shown the following script to grab information from an LDAP server and
display the results in a phonebook type format.
<HTML>
<BODY>
<?php
$ldapserver = "ldap.something.com";
$basedn = "dc=something, dc=com";
$dir =ldap_connect($ldapserver); // Connect to server
if ($dir) {
ldap_bind($dir); // Bind to the server
$result = ldap_search($dir, $basedn, "sn=*"); // query connection, set
the base and look for any sn
$info = ldap_get_entries($dir, $result); // The results get sent to the
$info object
for ($i=0; $i<$info["count"]; $i++) { // Count is a ldap feature that
contains the length of the resultset
echo $info[$i]["cn"][0]; // choose any parameter you want see here
}
ldap_close($dir);
}
?>
</BODY>
</HTML>
The problem I am running into I think is that I work for a school district,
and I don't have a .com address. I have anoka.k12.mn.us. I tried to put in
$basedn = "dc=anoka, dc=k12, dc=mn, dc=us"; but I still receive an error on
ldap_search. Am I doing this correctly?
Mike
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]