I\'m facing a problem that my function is called twice everytime i submit my form
my form file with the call to the function:
When you create a Class, you should specify a Constructor.
If you dont specify a Constructor, it's called by Magic Methods.
In Your Case, you create a Class Without a constructor, by with a function with the same name of the Class. Class Login -> Method Login. The PHP Acts like the Login Method is your constructor...
So when you call $login = new Login() you are calling the constructor that's the Login Method.
And when you call Login Method, $login->login(), you are calling it twice.
Are you understood?