Online Laptop shop using php and mysql
- HTML5
- CSS3
- Core/Procedural PHP programming language
- MySQL Relational Database
- Visitors/Users can browse all the Categories and Laptop Items.
- They also can order easily from the website.
- Admin can Manage Admin, Caegories and Laptop/device Items
- Admin can also Manage and Track device Order and Delivery
- Download and Install XAMPP
- Install any Text Editor (Sublime Text or Visual Studio Code or Atom or Brackets)
- Download as as Zip or Clone this project
- Move this project to Root Directory
Local Disc C: -> xampp -> htdocs -> 'this project'
Local Disk C is the location where xampp was installed
-
Open XAMPP Control Panel and Start 'Apache' and 'MySQL'
-
Import Database
a. Open 'phpmyadmin' in your browser b. Create a Database c. Import the SQL file provided with this project
- Make Changes to settings
Go to 'config' folder and Open 'constants.php' file. Then make changes on following constants
<?php
//Start Session
session_start();
//Create Constants to Store Non Repeating Values
define('SITEURL', 'http://localhost/website/'); //Update the home URL of the project if you have changed port number or it's live on server
define('LOCALHOST', 'localhost');
define('DB_USERNAME', 'infoogeek');
define('DB_PASSWORD', '');
define('DB_NAME', 'laptop_shop');
$conn = mysqli_connect(LOCALHOST, DB_USERNAME, DB_PASSWORD) or die(mysqli_error()); //Database Connection
$db_select = mysqli_select_db($conn, DB_NAME) or die(mysqli_error()); //SElecting Database
?>
- Now, Open the project in your browser. It should run perfectly.
In Linux/Arch
- Download apache and mariadb, php and php-apache pacman -Syu pacman -S php php-apache pacman -S mariadb apache
set up the LAMP(Linux Apache Mysql/Mariadb Php) : https://forum.manjaro.org/t/howto-install-apache-mariadb-mysql-php-lamp/13000?page=2
root directory for apache is /srv/http
start mariadb or mysql using : sudo systemctl start mariadb start apache server : sudo systemctl start httpd
go to localhost and dir name if in /srv/http the folder is website then got to localhost/website to get to the home page and localhost/website/admin to get to the admin login page
import the sql file for database
-
make a database in maraidb/mysql
mysql -u usernamae -p create database laptop_shop; quit then, import the database file from this peoject to the database on your machine mysql -u username -p laptop_shop < sqlfie.sql (note: to export from local db to a file : mysqldump -u username -p local_db > dbfile.sql)
then you're good to go after editing in config/constants.php
Yog Raj Dhakal(Loma) - MU