$html = include ('html文件');
echo $html;
ob_start(); //打开缓冲区
header("Cache-Control: public");
Header("Content-type: application/octet-stream");
Header("Accept-Ranges: bytes");
$riqi=date("Ymd");
if (strpos($_SERVER["HTTP_USER_AGENT"],'MSIE')) {
header('Content-Disposition: attachment; filename='.$riqi.'.doc');
}else if (strpos($_SERVER["HTTP_USER_AGENT"],'Firefox')) {
Header('Content-Disposition: attachment; filename='.$riqi.'.doc');
} else {
header('Content-Disposition: attachment; filename='.$riqi.'.doc');
}
header("Pragma:no-cache");
header("Expires:0");
ob_end_flush();//输出全部内容到浏览器
//内容过大输出失败, 请修改php.ini output_buffering
本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!