我想在php if语句中运行这行代码。我会这样做吗?
if (mail("m@me.com",$subject,$ipmessage,$header) ==1){
echo "Thank You Your Message Has Been Sent!";
<meta http-equiv="refresh" content="3;url=index.php">
}
答案 0 :(得分:2)
if (mail("m@me.com",$subject,$ipmessage,$header)){
echo "Thank You Your Message Has Been Sent!";
?>
<meta http-equiv="refresh" content="3;url=index.php">
<?php
}
?>
对于php中的 HEADER -
最终编辑 -
if (mail("m@me.com",$subject,$ipmessage,$header)){
echo "Thank You Your Message Has Been Sent!";
header("Refresh: 3;index.php");
}
答案 1 :(得分:0)
在特定时间间隔后尝试使用标题重定向此代码。
<?php
ob_start();
if (mail("m@me.com",$subject,$ipmessage,$header)){
echo "Thank You Your Message Has Been Sent! ";
header("Refresh: 10; url=index.php"); //You will be redirect in 10 seconds
}
ob_flush();
?>