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.
Paths reflect the project root: c:\xampp\htdocs\e-comm-project.
C:\xampp\htdocs (this repo should already be there).Create the database and tables (via phpMyAdmin or MySQL CLI):
php_e-comm.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
);
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
);
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.php validates and sanitizes input and stores submissions in the contacts table using a prepared statement.style.css contains the main site styling, including glassmorphism utilities and animation keyframes.admin/admin_style.css contains styles for the admin sidebar and header, updated to match the glass aesthetic.backdrop-filter (and -webkit-backdrop-filter) for the frosted-glass look. There are fallbacks for browsers that don’t support it and for users who prefer reduced transparency/motion.password_hash().users and contacts using the SQL snippets above via phpMyAdmin or the MySQL CLI.home/register.php) or check Apache’s error log at C:\xampp\apache\logs\error.log.