$one=$_POST['one'];
$two=$_POST['two'];
$three=$_POST['three'];
$four=$_POST['four'];
$five=$_POST['five'];
$six=$_POST['six'];
$seven=$_POST['seven'];
$eight=$_POST['eight'];
$nine=$_POST['nine'];
$ten=$_POST['ten'];
if ( $one == "gift" or $two == "gift" or $three == "gift" or $four == "gift" or $five == "gift" or $six == "gift" or $seven == "gift" or $eight == "gift" or $nine == "gift" or $ten == "gift" ) {
echo "<meta http-equiv='refresh' content='0; url=./gift.php?item=" . ??? . "' />";
}
我该怎么办?填写触发if语句的变量名...
答案 0 :(得分:7)
$key = array_search('gift', $_POST);
if ($key) {
echo "$key equals 'gift'";
} else {
echo "nothing equals 'gift'";
}