php创建表格没有显示,PHP-表格未显示后的感谢页面

在通过send_mail.php发送此邮件后,如何使该页面直接转到该邮件.inc.php-文件结构中相同位置的另一个名为ack.php的感谢页面?

function mail_file($to, $from, $subject, $body, $file) {

$boundary = md5(rand());

$headers = array(

'MIME-Version: 1.0',

"Content-Type: multipart/mixed; charset=UTF-8; boundary=\"{$boundary}\"",

"Content-Transfer-Encoding: 8bit", //Nytt 170711

"From: {$from}"

);

$message = array(

"--{$boundary}",

//'Content-Type: text/HTML; charset=iso-8859-1', 170707

'Content-Transfer-Encoding: quoted-printable',

'',

quoted_printable_encode($body), // Här är nya innehåll kodat som quoted-printable istället.

'', // Kommer orsaka en extra radbrytning efter meddelandet.

"--{$boundary}",

"Content-Type: {$file['type']}; name=\"{$file['name']}\"",

"Content-Disposition: attachment; filename=\"{$file['name']}\"",

"Content-Transfer-Encoding: base64",

'',

chunk_split(base64_encode(file_get_contents($file['tmp_name']))),

"--{$boundary}--",

'',

);

mail($to, $subject, implode("\r\n", $message), implode("\r\n", $headers));

}

?>

解决方法:

在代码末尾添加标头:

header('Location: http://www.example.com/thank_you.php');

它将用户重定向到指定页面

编辑:

同时删除您的第一个标题:

php header ("Content-Type: text/html; charset=utf8");

您不需要它,因为您不应该返回任何东西

标签:send,email,php

来源: https://codeday.me/bug/20191111/2018060.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值