2 回答
TA贡献1865条经验 获得超7个赞
你可以把这一行放在你的代码中:
echo "<script>window.location='successPage.php'</script>";
从而成为成功的一部分:
if ($sendEmail == true):
echo '{ "alert": "success", "message": "'.$message_success.'" }';
echo "<script>window.location='successPage.php'</script>";
else :
echo '{ "alert": "error", "message": "Email <strong>could not</strong> be sent due to some Unexpected Error. Please Try Again later.<br /><br /><strong>Reason:</strong><br />'.$mail - > ErrorInfo.'" }';
endif;
TA贡献1788条经验 获得超4个赞
你可以试试:
if ($sendEmail == true):
echo '{ "alert": "success", "message": "' . $message_success . '" }';
die('<script type="text/javascript">window.location.href=somepage.html;</script>');
或者
if ($sendEmail == true):
echo '{ "alert": "success", "message": "' . $message_success . '" }';
header('Location: somepage.html');
- 2 回答
- 0 关注
- 152 浏览
添加回答
举报