I am trying to pull info from an Exchange LDAP server to make a dynamically
created phonebook, and am having trouble with one field. I think the problem
is that the script I have has everything pulled in an array, and all but the
field I am having problems with are strings. The telephoneNumber would be
integer. Would this cause the telephoneNumber info to not show up when I
view it through a web browser?

Here is the script I have.

<?php
$ldapserver = "myserver.com";
$basedn = "o=myOrganization";
$attribs = array ("cn", "title", "department", "telephoneNumber");

$dir = ldap_connect($ldapserver)
  or die("Failed to connect to LDAP server");

$r = ldap_bind($dir)
  or die("Failed binding to server");

$result = ldap_search($dir, $basedn, "sn=T*", $attribs)
  or die("Error executing LDAP search");

$info = ldap_get_entries($dir, $result);
print count($info) . "entries returned<br>";

print "<table>";

for ($i=0; $i<$info["count"]; $i++) {

print "<tr>";
print "<td>";
print $info[$i]["cn"][0];
print "</td>";
print "<td>";
print $info[$i]["title"][0];
print "</td>";
print "<td>";
print $info[$i]["department"][0];
print "</td>";
print "<td>";
print $info[$i]["telephoneNumber"][0];
print "</td>";
print "</tr>";

  }

ldap_close($dir);
?>


-- 
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]

Reply via email to