【发布时间】:2019-05-20 15:42:53
【问题描述】:
这些表单在提交后工作。但是在刷新页面后邮件一次又一次地发送。
<?php
$to = "abc.com";
$subject = "This is subject";
$message = "<b>This is HTML message.</b>";
$message .= "<h1>This is headline.</h1>";
$header = "From:mithlesh@rightturn.co.in \r\n";
$header .= "MIME-Version: 1.0\r\n";
$header .= "Content-type: text/html\r\n";
$retval = mail ($to,$subject,$message,$header);
if( $retval == true ) {
echo "Message sent successfully...";
}else {
echo "Message could not be sent...";
}
?>
【问题讨论】:
-
你不把这个放在 if(isset($_POST)) 中是什么?
-
@MagnusEriksson,对不起我的朋友。它显示了一些错误,网络问题。多条评论从来不是我的本意