Я НЕ УВЕРЕН, ЕСЛИ МОИ ЕСЛИ ЗАЯВЛЕНИЯ ПРАВИЛЬНЫ -
я хочу, чтобы код заканчивался , если переменная $answer
не '4'
или 'four'
.
Если переменная $answer
равна 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