我一直在研究这段代码,错误引起的任何事情都没有任何意义,我已经搜索过但我无法找到可行的解决方案,或者任何人解释为什么我可以在将来阻止它。
抛出此错误:
解析错误:语法错误,意外'否则' (T_ELSE)在第139行的/home/cabox/workspace/up/frontend/pages/settings.php中
第139行是第一个else
语句:
if (isset($_GET['act'])) {
$act = $_GET['act'];
$arr = array('delete');
$arr2 = array('blacklist');
$arr3 = array('unblacklist');
if (in_array($act, $arr)) {
$de = $odb->prepare("DELETE FROM login_attempts WHERE id = :i");
$de->execute(array(":i" => $tid));
echo '<div class="alert alert-success">log deleted. </div><meta http-equiv="refresh" content="2;url=settings.php">';
break;
}else{
echo '<div class="alert alert-danger">Something went wrong, please try again</div>';
}
}else{
}
if (in_array($act, $arr2)) {
echo 'div class="alert alert-danger">blacklist</div>';
}else{
$getblack = $_GET['ip'];
$de2 = $odb->prepare("INSERT INTO blacklist VALUES(null, :ip)");
$de2 = $odb->execute(array(":ip" => $getblack));
}else{
echo '<div class="alert alert-danger">Something went wrong, please try again</div>';
}
}