php sendmail没有重定向到给定的url?

php sendmail没有重定向到给定的url?,php,sendmail,redirect,Php,Sendmail,Redirect,我的php sendmailscript不工作,它发送邮件,但没有重定向到给定的url <? session_start(); if ($_SERVER["REQUEST_METHOD"] <> "POST") die("You can only reach this page by posting from the html form"); if ($_POST["captcha_input"] == $_SESSION["pass"]) { echo '<META H

我的php sendmailscript不工作,它发送邮件,但没有重定向到给定的url

<?
session_start();
if ($_SERVER["REQUEST_METHOD"] <> "POST")
die("You can only reach this page by posting from the html form");
if ($_POST["captcha_input"] == $_SESSION["pass"])
{
echo '<META HTTP-EQUIV=Refresh CONTENT="0; URL='.$url.'">';
$mailuser = "rohit007@gmail.com";
$url = "index.html"; 
$header = "Return-Path: ".$mailuser."\r\n"; 
$header .= "From: form with captcha <".$mailuser.">\r\n"; 
$header .= "Content-Type: text/html;"; 

$mail_body = '
<b>Name</b> : '. $_POST[Name] .'<br><br>
<b>Email</b> : '. $_POST[Email] . '<br><br>
<b>Mobile</b> : '. $_POST[Mobile] . '<br><br>
<b>Unit Type</b> : '. $_POST[select] . '<br><br>
<b>Comments</b> : '. $_POST[Query] . '<br>'
;
mail ($mailuser, 'Enquiry', $mail_body, $header);
echo 'THANKS ';
} else {
echo "Sorry! you did not pass the Security Check.<br><br>";
echo "Please go <a href='javascript:history.go(-1)'>back</a> and try again.";
}
?>

请使用PHP的重定向头。 有关PHP电子邮件教程,请查看以下链接


在Ita中输出带有变量的meta后设置url的位置。事实上,我对php不熟悉,您能帮我吗?切换这些行以返回“”;和$url=“index.html”;因此,您的变量在输出之前就已经设置好了。您应该在PHP中使用
标题(“Location:$url”)
函数,而不是meta-HTTP-EQUIV标记。