Skip to content

alexandru0-dev/registrationForm

Repository files navigation

PHP Registration/Login Form

Registration and Login Form for school assignment using bcrypt algorithm with cost 8 to hash passwords

BACK-END:

Made with PHP and Twig HTML Engine\

Twig allow to create template of html (see /templates) and to render them

DATABASE:

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

To Run:

Requirements:

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}

TO DO:

  • 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

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License

[email protected]