Changeable password lock system

To clarify that @peterjin I'm not doubting the ability of our members to resolve this problem, I'm trying to give the OP some guidance on how they can address issues like this in future - by focussing on the parts of their code that are relevant to the issue.