php页面跳转 怎么写

lianglei9810 2008-12-24 09:31:48
<?php
$arr['mail_to']="lianglei@help.cn"; //目的地邮箱
$arr['mail_from']="lianglei@help.cn"; //源邮箱
$arr['mail_subject']="subject"; //邮件标题
$arr['mail_body']= "name:"+$_POST['txtName']+" City:"+$_POST['txtCity']+" Message:"+$_POST['txtMessage']+" Country:"+$_POST['txtCountry']+" Tel:"+$_POST['txtTel']+" Email:"+$_POST['txtEmail']; //邮件正文
$arr['is_html']=Flase; //是否html邮件,是或否
em_local_send($arr);
function em_local_send($arr){
$mail_to = $arr['mail_to'];
$mail_from = $arr['mail_from']=="" ? 'lianglei@help.cn' : $arr['mail_from'];
$mail_subject = $arr['mail_subject'];
$mail_body = $arr['mail_body'];
$is_html = $arr['is_html'];

$header = "";
if ($is_html){
$header .= "MIME-Version: 1.0\r\n";
$header .= "Content-Type: text/html; charset=UTF-8\r\n";
$header .= "To: $mail_to\r\n";
}
$header .= "From: $mail_from\r\n";
$header .= "Reply-To: $mail_from\r\n";
$header .= "X-Mailer: Heiyeluren-Mailer\r\n";
return mail($mail_to, $mail_subject, $mail_body, $header);
}
?>
我想在这后面加句页面跳转 谢谢
还有个问题 就是 $arr['mail_body'] 内容为什么不是上页表单里填的东西 而且连 我手写的字符串都没有 值为:738或 369或0?请高手指点
...全文
183 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
penglewen 2008-12-24
  • 打赏
  • 举报
回复
em_local_send($arr);
echo '<script language="javascript">';
echo 'window.location.href="test.php"';
echo '</script>';改成这样。
lianglei9810 2008-12-24
  • 打赏
  • 举报
回复
页面代码都在上面呢 我不知道 哪句话是输出 我对php十窍不通
itian 2008-12-24
  • 打赏
  • 举报
回复
header前不能有输出
lianglei9810 2008-12-24
  • 打赏
  • 举报
回复
header("location:test.php");这句加上 后报错啊 Warning: Cannot modify header information - headers already sent by (output started at /home/p14fpthc/public_html/sendEmail.php:2)
penglewen 2008-12-24
  • 打赏
  • 举报
回复
em_local_send($arr);
header("location:test.php");加在后面这里,
penglewen 2008-12-24
  • 打赏
  • 举报
回复
$arr['mail_body']= "name:".$_POST['txtName']." City:".$_POST['txtCity']." Message:".$_POST['txtMessage']." Country:".$_POST['txtCountry']." Tel:".$_POST['txtTel']." Email:".$_POST['txtEmail']; //邮件正文


php连接字符串用"."号

21,882

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧