I am flabbergasted by the code, where the GET-values, such as $_GET[\'username\']
, are not included as parameters to functions.
When do you need to inc
$_GET and $_POST are global variables. They have values, not methods.
It is their values you want to send to functions, and classes/functions should generally be unaware of anything outside them, like where the data comes from. Many use the shortcut of using the global variables in functions, and thus limiting the usability of their functions.