I am flabbergasted by the code, where the GET-values, such as $_GET[\'username\'], are not included as parameters to functions.
$_GET[\'username\']
When do you need to inc
You don't need to send them as function parameters as they are global variables (accessible everywhere in the code).
But it's always a good practice to filter and validate them before you use them in your code.