2013-12-08 2 views
0

php sendmailscript가 작동하지 않습니다. 메일을 보내지 만 지정된 URL로 리디렉션하지 않습니다.php sendmail이 주어진 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 = "[email protected]"; 
$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."; 
} 
?> 
+0

당신은 후 –

+0

실제로 내가 PHP는 새로운, 당신이 나를 도울 수 있어요 거기에 변수로 메타를 출력 URL의 위치를 ​​설정? –

+0

이 줄을 전환합니다. '' '; 및 $ url = "index.html"; 변수를 출력하기 전에 변수를 설정하십시오 –

답변

0

PHP의 리디렉션 헤더를 사용하십시오. PHP 이메일 자습서의 경우 다음 링크를 확인하십시오.

+0

사실 저는 PHP에 처음입니다. 코드를 수정하십시오! –

+0

헤더 ('위치 : http://www.example.com/'); –

관련 문제