Remove the spaces in your else if
s such that they become elseif
s. PHP interprets else if
as though it were an if
conditional nested within an else
, and as such is expecting the else :
to match your if :
when it encounters else{ if(){} }
instead. See 4661508 and 3385213 for more precise details 🙂