I want to create a simple login system in my website I am developing for academic purpose.
This is what I did so far:
- A user will have to fill out a form to input their username and
password, and then submit the form (
POSTmethod). Both vars will be sanitized. Query from database
SELECT id FROM user WHERE username = x AND password = yWhere
xandyare username and password acquired using$_POST['variable_name']Then I used PHP function
rowCount(). If the result = 1 (and only one), then that user will be notified that the login process is successful and a user id session var will be set.
So, is this kind of login system simple and efficient enough? I don't need any additional security measure (like password hashing) right now.
prepare()andexecute()? If so, yes I can use that. Ditto onpassword_hashandpassword_verify.