HNG Task 1 - Team Dauntness, Simple PHP Form
An interacting web user interface is dependent on one deciding factor, the user. while their impotance can not be overestimated, it however important to find a way to restrict unauthorized access to member-only area and tools on a site. In this tutorial, we'll create a simple login with php. This tutorial comprises of two parts, in the first part, we will create the login form, and in the later part, we will deal with authentication. **Step1: Creating the Structure** First, Open up your favorite editor and create a login.php file. create the structure in your login.php file for example !(/storage/1043/images/img-5n9cp9kahv.png) **Step 2: Creating the Forms** Since we are creating a user login, you might want to first give the people the option of registering or login with facebook, google or linkedin, you'll have to wrap it in a card though like the example below !(/storage/1043/images/img-oyx6fp9tlw.png) The login form would then be created !(/storage/1043/images/img-nac9o8y0n4.png) **Step 3: Aunthenticating user login** For this tutorial, we will use two hand-coded username namely username1 with its password as password1 and username2 with password2. To check if user entered the right inputs, Firstly, we need to start a PHP section with inbuilt section, then check if the login form is submitted, afterwards, create an hard-coded username and password for example !(/storage/1043/images/img-tfpbjw9kma.png) Therafter check if Check Username and Password existence in defined array, if it is true, Set session variables and redirect to Protected page and if not, it should display an error message !(/storage/1043/images/img-18ug8z8dlj.png) There, we have created a login page. You can check the repo of example used in this tutorial [here](https://github.com/idmcalculus/hng-dauntless-task1).