Registration and Login Form for school assignment using bcrypt algorithm with cost 8 to hash passwords
LINK: Altervista website
Made with PHP and Twig HTML Engine\
Twig allow to create template of html (see /templates) and to render them
SQL query used to create the table of the form:
CREATE TABLE IF NOT EXISTS form (
ID INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(255) NOT NULL,
surname VARCHAR(255) NOT NULL,
email VARCHAR(255) NOT NULL,
username VARCHAR(255) NOT NULL,
password_hash VARCHAR(255) NOT NULL,
telephone VARCHAR(255) NOT NULL,
newsletter BOOLEAN NOT NULL DEFAULT 0,
preference VARCHAR(255) NOT NULL,
billing_method VARCHAR(255) NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
) ENGINE=INNODB;
Queries are PREPARED STATEMENTS
This prevents SQL injections from happening
Requirements:
- Composer (install steps here)
Then to install dependencies run:
composer install
after that you can simply run a php server, for example using php command with the following values:
php -S {address}:{port}
- Add JWT TOKEN auth
- Add possibility to get back to another page during the sign in or the sign up
- Sign in with Google
Copyright © Alexandru Nechita, 2021
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License