[PHP] postgresql - image - php

2002-08-12 Thread Hafiz Malik

anyone know how to store an image to postgresql and load it back using php?



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




[PHP] PHP LDAP

2001-12-03 Thread Hafiz Malik

hi there..
i'm succesfully add ldap entry(jpegphoto) using PHP via below codes..
but failed to modify it.. any ideas?


ADD LDAP ENTRY VIA PHP
$userfile = addpicture.jpg;
$fd = fopen ($userfile, r);
$fsize = filesize ($userfile);
$jpegStr = fread ($fd, $fsize);
 fclose ($fd);

$ds = ldap_connect(localhost);
$r= ldap_add($ds,
uid=$uid,dc=orenda,dc=com,
 array(objectclass = inetorgperson,
 cn= $cn,
 uid   = $uid,
 jpegphoto = $jpegStr ) );


MODIFY LDAP ENTRY VIA PHP
$userfile = modifypic.jpg;
$fd = fopen ($userfile, r);
$fsize = filesize ($userfile);
$jpegStr = fread ($fd, $fsize);
fclose ($fd);

$ds = ldap_connect(localhost);
$bindp = secret;
$bindn = uid=admin, dc=orenda, dc=com;

ldap_bind($ds,$bindn,$bindp);
$dn = uid= . $uid . , .dc=orenda, dc=com;

$info['cn']=$cn;
$info['jpegphoto']=$jpegStr;
$info['objectclass']=person;
if (count ($info) != 0)
$r = ldap_modify ($ds, $dn, $info);


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