php通过网页下载csv文件
我正在尝试这个简单的代码通过我的网页下载csv文件,但没有成功php通过网页下载csv文件,php,html,Php,Html,我正在尝试这个简单的代码通过我的网页下载csv文件,但没有成功 <?PHP header('Content-Type: application/csv'); header('Content-Disposition: attachment; filename=test.csv'); header('Pragma: no-cache'); echo readfile('test.csv'); ?> 错误是“
<?PHP
header('Content-Type: application/csv');
header('Content-Disposition: attachment; filename=test.csv');
header('Pragma: no-cache');
echo readfile('test.csv');
?>
错误是“internet explorer在我的网页上找不到”csv_download.php“文件链接
<a href="csv_download.php">Click here to download the "CSV" file</a>
缺少任何内容?您的PHP文件不在您期望的URL处。请始终尽可能设置完整路径:
<a href="/csv_download.php">...
。。。
您的PHP文件的名称或位置错误