您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

php 生成word文档并下载代码_PHP教程

2024/12/9 22:03:34发布9次查看
php教程 生成word文档并下载代码
include(include/conn_mysql教程.php);
  $id=$_get[id];
  $sql=select * from  down where id=$id ;
  $result=mysql_query($sql);  
  $row=mysql_fetch_row($result);
  $file2=$row[upload];
function downfile($sfilepath)
{
   if(file_exists($sfilepath)){
       $afilepath=explode(/,str_replace(,/,$sfilepath),$sfilepath);
       $sfilename=$afilepath[count($afilepath)-1];
       $nfilesize=filesize ($sfilepath);
       header (content-disposition: attachment; filename= .basename($sfilename) );
       header (content-length: . $nfilesize);
       header (content-type: application/octet-stream);
       mb_convert_encoding(readfile($sfilepath),utf-8,gb2312);
   }
   else
   {
       echo(文件不存在!);
   }
}
downfile($file2);
/*
这个生成word生成文档程序是从mysql数据库教程读取数据保存文件再用header来发送给浏览器。
*/
http://www.bkjia.com/phpjc/444921.htmlwww.bkjia.comtruehttp://www.bkjia.com/phpjc/444921.htmltecharticlephp教程 生成word文档并下载代码 include(include/conn_mysql教程.php); $id=$_get[id]; $sql=select * from down where id=$id ; $result=mysql_query($sql); $row=mysql_fetch_r...
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product