E-commerce-site

A mini PHP + MySQL e-commerce demo built for local development (XAMPP). It includes basic product listing, an admin panel (product management), and a registration form. The project uses plain PHP (no framework), MySQL, and vanilla CSS. Recent updates added a pleasant visual theme and subtle UI animations.

Features

Tech stack

Paths reflect the project root: c:\xampp\htdocs\e-comm-project.

Quick setup (Windows + XAMPP)

  1. Install XAMPP and start Apache and MySQL from the XAMPP Control Panel.
  2. Place the project folder inside C:\xampp\htdocs (this repo should already be there).
  3. Create the database and tables (via phpMyAdmin or MySQL CLI):

    • Create a database named php_e-comm.
    • Create the required tables (examples below). This project no longer creates tables automatically, so run the SQL yourself.

Example users table SQL

CREATE TABLE IF NOT EXISTS users (
  id INT AUTO_INCREMENT PRIMARY KEY,
  name VARCHAR(100) NOT NULL,
  email VARCHAR(100) UNIQUE NOT NULL,
  password VARCHAR(255) NOT NULL,
  phone VARCHAR(20),
  address TEXT,
  usertype VARCHAR(10) DEFAULT 'user',
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

Example contacts table SQL (for contact.php)

CREATE TABLE IF NOT EXISTS contacts (
  id INT AUTO_INCREMENT PRIMARY KEY,
  name VARCHAR(150) NOT NULL,
  email VARCHAR(150) NOT NULL,
  phone VARCHAR(50),
  subject VARCHAR(255),
  message TEXT NOT NULL,
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
  1. Open the site in your browser:

    http://localhost/e-comm-project/index.php

    Admin pages (if available) are under http://localhost/e-comm-project/admin/.

Contact page behavior

Styling notes

Security notes

Troubleshooting

Contributing

  1. Fork or clone the repo.
  2. Create a feature branch, implement changes, and test locally (XAMPP).
  3. Open a pull request describing your changes.