1

我想在 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">
}
4

2 回答 2

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");
  }
于 2012-10-08T03:56:21.247 回答
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();
?>
于 2012-10-08T04:13:15.303 回答