Php 下载.doc不工作但在同一浏览器上打开为什么

Php 下载.doc不工作但在同一浏览器上打开为什么,php,Php,下载.doc不工作但在同一浏览器上打开为什么 if ($stmt->execute(array($userID))) { $stmt->execute(); header("Content-type: application/vnd.ms-word"); header('Content-type: text/plain charset=utf-8'); header('Content-Disposition: attachment; filename=export.doc');

下载.doc不工作但在同一浏览器上打开为什么

if ($stmt->execute(array($userID))) 
{
$stmt->execute();
header("Content-type: application/vnd.ms-word");
header('Content-type: text/plain charset=utf-8');
header('Content-Disposition: attachment; filename=export.doc');

while ($row = $stmt->fetch()){
$username=htmlspecialchars($row['userName']);
<table width='90%' height='60%' align='center' border='1' dir='rtl'>

download .doc  not working but open on a same  browser why
if($stmt->execute(数组($userID)))
{
$stmt->execute();
标题(“内容类型:application/vnd.ms word”);
标题('Content-type:text/plain charset=utf-8');
标题('Content-Disposition:attachment;filename=export.doc');
而($row=$stmt->fetch()){
$username=htmlspecialchars($row['username']);
下载.doc不工作但在同一浏览器上打开为什么

请您解释一下好吗?export.doc是php页面中的名称文件下载,单击按钮下载文件时从查询中获取结果。文件在同一brwser中打开,而不是像对话框一样强制下载为附件。请您解释一下好吗?export.doc是php页面中的名称文件下载,单击按钮下载时从查询中获取结果lod文件。文件在同一brwser中打开,不强制下载作为附件作为对话框