我在 mysql 中有 3 个字段,分别为 color1、colour2、colour3,其值为“红色”或“蓝色”。当考勤 1 2 和 3 提交时,它会保存在 mysql 中,然后重定向到 Submitted1.html。
但是,如果每个字段的值为“否”,我希望它重定向到 Submit2。
最佳答案
只需将其添加到最后一个标题上方即可
if($_POST['attendance1'] == 'no' && $_POST['attendance2'] == 'no' && $_POST['attendance3'] == 'no'){
header("Location: otherpage.html");
exit();
}
关于php - 根据 mysql 字段值进行重定向,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9527359/