@Edward Currently, the question is closed. My opinion is that because this is strictly a code-based question, it would have better been migrated over to Stack Overflow rather than closed, but either way it's not a great fit for this site.
On the other hand, your answer is a good example of a frame challenge answer; you answer the question as asked, but also point out some more systemic issues the OP may not have been aware of. Well done.