繁体   English   中英

PHP的Sendmail没有重定向到给定的URL?

[英]php sendmail is not redirecting to the given url?

我的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电子邮件教程,请检查以下链接。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM