Jump to content

Archived

This topic is now archived and is closed to further replies.

vanviet

how to display image (OLE Object-MS Access)

Recommended Posts

hi, everyone!
i have some codes like this :
---------------
upload.htm
<form action="binary.php?act=1" method="post" enctype="multipart/form-data" name="form1">
  <label>
  <input name="filebinary" type="file" id="filebinary">
  </label>
<input type="hidden" name="MAX_FILE_SIZE" value="96000">
  <label>
  <input type="submit" name="Submit" value="Submit">
  </label>
</form>
---------------
binary.php
<?
$act=$_REQUEST[act];
include("databaseconnection.php");
if($act=="1")
{
$handle =fopen($_FILES['filebinary']['tmp_name'],'rb');
$size=filesize($_FILES['filebinary']['tmp_name']);
$sql="INSERT INTO art(matp,tentp,kichthuoc,image,gia) VALUES('1','1','1','$handle',$size)";
$ok=odbc_exec($conn,$sql);
if(!$ok)
{
echo "khong thanh cong <br>";
}
else
{
echo "thanh cong <br>";
echo "<a href =binary.php?act=2>click here</a>";
}
}
elseif($act==2)
{
$sql="SELECT * FROM art ";
$ok=odbc_exec($conn,$sql);
while(odbc_fetch_row($ok))
{
$image=odbc_result($ok,"image");
echo fwrite($image,'wb');
}
}
?>
--------------
i know it has some errors but i tried to get better .finally ,nothing changes.
show me how to display image ?
 

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.