我已经修改了 PHP,希望它能解决你的两个问题:
这在打开的 php 标签之后
// get the status from the url bar
$status = $_GET['status'];
修改成功消息:
if ($success){
// we want to redirect via PHP so that users do not get that "resubmit message"
header('location: '.$_SERVER['PHP_SELF'].'?status=sent');
} else {
// we want the form to show up again? so, pass an error
$status = 'error';
}
这正好在结束“?>”标签之前:
# run the status through a switch if not empty
if(!empty($status)) {
switch($status) {
case 'sent':
echo('<p class="feedback yay">All is well, your e–mail has been sent.</p>');
break;
case 'error':
echo('<p class="feedback oops">Something went wicked wrong; maybe you clicked too hard.</p>');
break;
}
}