Soromkelechi Apugo
php, html, form, form validation, php auth, html5 form validation
TEAM-GRAVITY: HOW TO CREATE A SIMPLE SIGN UP/SIGN IN SYSTEM

**Introduction** In case you’re wondering why we need a sign-up and then a sign in. The sign-up form receives initial inputs from a first time user and stores in the database. When such a user revisits the platform, he/she doesn’t have to sign up again since his/her details are already stored by the system. But then, there should be a way for the system to match this user’s records with the data in the database to ensure it is still you. That is where the sign-in comes in. In the sign-in, the user’s data are not stored in the database all over again, rather, the inputs are matched against previously saved records using the primary keys, once a match is found, the user is logged into the appropriate account. But for the scope of this tutorial, the user receives a success message on a successful login. **Building a Sign in/Sign Up page** On your editor, you can input the following code into your HTML structure. ![sign up](https://lh5.googleusercontent.com/Hbda1tKvbrTaoUilrSpe2e_hTJqd38gQaZdnutWM1t_Xc8_cDNaM4BWcEsVzDaSzKLc1ZgKT1qT2ZuEEeTTPCQV67kIpE7Is3z472mOr75Zr_Yu37jCjXimM6leVXnXL_b5WoGdWP_5D07RmEA) The input tag shows where a user can enter data in the form. After which the user clicks on the button for submitting. On submit, the data which has been inputted is sent to the database. The code for the sign up can be tweaked appropriately to make a **sign-in** page, only the functionality needs to be changed as we see as we proceed. **Validate a form using HTML 5** **HTML** 5 provides  simple means of validating user inputs using the **type** attribute. Setting the type to **email**, text**, password**which were basically required in our form accompanied with the **required** attribute are used to check that the user enters the required input type in the form. **The Back-end Part** Our login and registration pages are tied to one file(index.php in the app folder) **![](https://lh5.googleusercontent.com/GrlISCZ-XdGD2oQ2yGuzCKWIjBJMdbxwawOxjyRRfmARmJYwBp5cUpZVuxaPFw_ISGUWut094vtaNwemqzm9K2mHjPLdgJ0xnbD5SkFdmeDb-nypFGnSXgiP8P1GgoH-802tOOQF)** From the code above, we are checking the values that are entered in the form inputs whenever one makes a POST  request. It checks if the email address  and password already registered(I.e,  if the details are already in the database), if it is registered. It grants access to a success page(Isuccess.php) The code above checks for few conditions  before letting one actually registers and stores the information in the user.json file inside the **db** folder… The code above does not allow one to register with different password in the first _Password_ input and in the _confirm Password_  because these two inputs have to be validated that they fit… And all these happen whenever a POST request is being made and it takes one to **succces.php** and displays the user’s information

Soromkelechi Apugo
The Journey so far - StartNg internship

So far the internship has been a roller coaster, never would have thought that looking at my screen for long would get tiring until now, well yes it does. Getting to read hundreds if not thousands of messages a day during classes, helping out fellow interns, or even making transcripts of lectures...

Soromkelechi Apugo
My First Post - The Start-Ng pre-internship

Hi! I am George, and this is my first post on Lucid. I got to know about Lucid through Start-Ng's Pre-internship Organized by HNG internship i.e Hotel.Ng internship program which is on going now and i must confess that it is a lovely and amazing ride, to see over 8000 upcoming programmers under one roof...

Soromkelechi Apugo
Cascading Style Sheets - The beauty of Html

Life is beautiful they say, but i have never come to see it in a creators point of view until recently when i got the opportunity of getting a creating a skeleton and put flesh on it. Haaa! i got you right? I am not a doctor, and even doctors don't come close to creating skeleton and putting flesh on humans...