我想让用户下载一个PDF文件,下载代码如下...但是出现了一个奇怪的错误,即使文件正在下载,我也收到了一个说文件在服务器上已经损坏的错误...有人可以帮助我指出我犯了什么错误吗?
<php
$name = $_POST["name_first"];
$mail = $_POST['email'];
$number = $_POST['phone_number'];
$email_message = "first name: {$name} email is {$mail} number is {$number} ";
mail('fanaa@gmail.com', 'Form Response', $email_message);
if ($mail == "" OR $name == "" OR $number == "")
{
echo "Enter valid details ";
}
else
{
header('Content-type: application/pdf');
header('Content-Disposition: attachment; filename="tokina.pdf"');
readfile('docs/tokina.pdf');
}
?>
echo
或其他内容? - KingCrunch