日期:2011-11-22  浏览次数:20537 次

PHP上传二进制形式图片到数据库中,如下代码:

  1. <?php  
  2. session_start();  
  3. include("conn.php");?> 
  4. <html> 
  5. <head> 
  6. <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> 
  7. <title>以二进制形式上传图片到数据库 - www.cxybl.com</title> 
  8. <style type="text/css"> 
  9. <!-- 
  10. body { 
  11.     margin-left: 0px; 
  12.     margin-top: 0px; 
  13.     margin-right: 0px; 
  14.     margin-bottom: 0px; 
  15. .style1 {font-size: 12px} 
  16. --> 
  17. </style></head> 
  18.  
  19. <body> 
  20. <table width="355" height="222" border="0" align="center" cellpadding="0" cellspacing="0"> 
  21. <form action="index_ok.php" method="post" enctype="multipart/form-data" name