What is the point of this second redefinition of $posted? Maybe I'm missing something but on line 18 it is already defined. If the if statement at line 19 executes wouldn't it be changed back to false?