build an E-commerce with html, css (bootstrap), javascirpt and php – Part 4

Hello Guys, glad to see you again in this week. Hope, your day was great!

Today we are going to continue our previous lesson. In this part we will back to the second article where the index.php contains a jumbotron and product field. Now, turn your XAMPP and editor on. Allow me to continue this lesson.

Below is our index.php in previous lesson.

Now, press ctrl+a button on your keyboard and press del button to remove all of the element. And change to this code below or you can copy paste from earlier article here.

Now you can refresh your browser by pressing F5 button as usual. What we are going to do in this article is put the product from admin page. Before we are going to build CRUD (Create Read Update and Delete) system we will ensure the admin page cannot be accessed by another admin. So, lets make the login form for admin for the first time.

To make login form we have to create a table in our database, the table should have a name like category let put a name in this table called admin. This picture below show you how to setup admin table in your phpmyadmin.
create admin table
Type admin in the name field and set the number of columns: 4, then click go button on the bottom right. On the next page shown, fill the first columns with id the second with username and the third with password and the last with email. Do not forget to set the id with auto increment and don’t forget to save your table, see the picture below for details.
Setup admin table

after you redirected to the structure columns, click on insert menu to insert admin data, put your admin username in this case I will use admin for username and admin for password but I will use MD5 feature of SQL to secure admin page. see the picture below for details.

Insert admin data

after you hit the go button, you will be redirected to the SQL menu, Click browse, please to check your login credential. see the picture below.

Browse data on SQL
Now, you can login by this credential. Let’s make a login form, now! Switch your screen to the editor to start design a login page for admin.


No Comments

Write a Reply or Comment

Your email address will not be published. Required fields are marked *