의 문은 내 진술이 정확하면 잘 모르겠어요 'IF'- 변수 $answer
이 '4'
또는 'four'
하지 경우PHP
내가 코드를 종료 할.
가변적 인
$answer
은 4 또는 4와 같습니다. - 프로그램이 코드를 처리합니다.
도움을 주신 모든 도움. 그래서
에 그것의 더 나은
감사
if(! in_array($answer, array(4, 'four')))
{
//if answer is not in an array containing either 4 or four then..
echo "You have entered the security question incorrectly. Your request will NOT be processed";
exit();
}
else
{
if ($from != "")
{
//test send mail to Melanie
mail($to, $subject, $contents, $from_header);
// redirect back to url visitor came from
$display_blockmsg = "Thank you, <b>$_POST[title] $_POST[firstname] $_POST[lastname]</b>, <br>
Your contact form details have been sent to us <br>
Your contact details are:<br><br>
<b>Address:</b> $_POST[address1]
$_POST[address2],<br>
<b>City:</b> $_POST[city]<br>
<b>County:</b> $_POST[county]<br>
<b>Postcode:</b> $_POST[postcode]<br>
<b>Country:</b> $_POST[country]<br>
<b>Telephone:</b> $_POST[telephone]<br>
<b>email:</b> $_POST[from]<br><br>";
}
else
{
$display_blockmsg = "<center><b>The email field</b> is empty. Please go back and complete this field.</center>";
}
} //end of first else ...if
나에게 잘 어울립니다. – Pateman