Extracting images from active directory using php

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi All,
I am busy trying to display an image extracted from the active directory on
our intranet. This is what I have so far, I have searched the net on this
and come up with very little info.
The following just shows a page stating it could not display the image
because it had errors. If anyone has had experience with this please help...

<?php
$ldap_server = 'ldap://server.world.com';
$auth_user = 'joe@world.com';
$auth_pass = 'password';

$res=ldap_connect($ldap_server);
$bind=ldap_bind($res,$auth_user,$auth_pass);

$info = ldap_read($res,'CN=Joe
Bloggs,OU=Users,DC=world,DC=com','objectclass=*');


$ar = ldap_get_entries($res,$info);
$data = $ar[0]['thumbnailphoto'][0];

echo Header("Content-Type: image/jpg").$data;
?>

Cheers
Simon

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux