0

I've been working on this code awhile, the error thrown just doesn't make any sense, I've googled around but I just can't find a working solution, or anyone to explain why so I can prevent it in the future.

This error is thrown:

Parse error: syntax error, unexpected 'else' (T_ELSE) in /home/cabox/workspace/up/frontend/pages/settings.php on line 139

Line 139 is the first else statement:

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>';
        }
}
Rasclatt
  • 12,498
  • 3
  • 25
  • 33

0 Answers0