Preparation for Creating an Online Store or E-Commerce website

According to Wikipedia Online shop or E-commerce (electronic commerce) is the distribution, purchase, sale, marketing of goods and services through electronic systems such as the internet, mobile phones, television and other computer networks.

In this tutorial, I will share my experiences in creating a simple online store or e-commerce for you who are just learning to create an online store or e-commerce using PHP, Css, Javascript, ajax, Jquery and Html.

Table of contents :

  1. Determine the products to be sold
  2. Create an admin page for the backend
  3. Preparation of connection files to the database and other supporting files

1. Determine the products to be Sold

Before we create an online store or e-commerce, of course we have to determine what products will be sold on our website later, for example clothes, jewelry, cosmetics and others.

After we decide what products we will sell, the next step is to create an online store / e-commerce website.


2. Create an admin page for the backend

The first stage in creating a backend / admin page for our website is to design the backend form, here I am using a template from start bootstrap, you can download it here.


3. Preparation of connection files to the database and other supporting files

The next stage is to create supporting files and connection files to the database later, in the PHP Shopping Cart Tutorial – Create a MySQL Database, we have created a database and its tables, so now we will create a connection file to the database.

  1. Config.php

This file is connection to the database that contain the configuration of database server like server name, database name, user name and password, in the config.php file for variable names $server, $user, $pass and $database according to your data, $server is the name of your server, $user is the name of the user who can access the server, $pass is the user password and $database is the name of your database, please adjust it with your data.

<?php

$server = "localhost";
$user = "root";
$pass = "";
$database = "db_bukawarung";
 
$conn = mysqli_connect($server, $user, $pass, $database);
 
if (!$conn) {
    die("<script>alert('Failed connect to database.')</script>");
}

?>

2. Functions.php

the functions.php file it is almost the same as config.php only using OOP or Object Oriented Programming for the variable name data $server, $user, $pass and $database please adjust it according to your data.

Leave a Reply

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