我有两个组合框,一个用于报告得分,一个用于设置进球者,如果在 post['submit'] 上,我该如何做到这一点
如果 $_POST['Score1'] 和 $_POST['Score2'] 不等于 $_POST['homegoalscorer1'] 和 $_POST['awaygoalscorer1'] 则 echo"fail";
就像是;
if(isset($_POST['submit']))
{
$homescore = $_POST['Score1'];
$awayscore = $_POST['Score2'];
$homegoalscorer = $_POST['homegoalscorer1'];
$awaygoalscorer = $_POST['awaygoalscorer1'];
if '$homescore' + '$awayscore' != $homegoalscorer + $awaygoalscorer {
echo "failed";
}
else {
}
}
有任何想法吗?