Online Shopping Portal
Introduction
In the rapidly evolving digital age, the way consumers interact with businesses and purchase products has undergone a dramatic transformation. The advent of the internet and ICT have given rise to e-commerce. This project — "Online Shopping Website Using PHP and MySQL" — develops a fully functional, dynamic, and secure web application replicating core features of a commercial e-commerce platform.
Users can browse products, register accounts, log in, add products to a shopping cart, and place orders. A robust back-end database manages user credentials, product listings, cart information, and order history.
Objectives
- User-Friendly Interface — Simple, clean, and intuitive navigation for all users.
- Secure Authentication — Hashed passwords, role-based login for users and admin.
- Product Catalog — Dynamic listings with names, prices, descriptions, and images.
- Shopping Cart System — Add, update, remove items; real-time totals.
- Order Placement & Checkout — Smooth checkout with order records in database.
- Structured Database — Normalized MySQL schema for all entities.
- Basic Security Features — Input validation, session management, XSS protection.
Tools & Technologies
System Analysis
Need Identification: Growing demand for affordable, open-source online shopping solutions for small businesses and students, where traditional manual processes are slow and error-prone.
Problem Statement: Absence of an integrated, cost-effective e-commerce system with secure user management, organized product catalog, and reliable order processing.
Feasibility Summary:
| Feasibility | Status | Remarks |
|---|---|---|
| Technical | ✓ Feasible | PHP + MySQL are open-source, well-documented, platform-independent |
| Economic | ✓ Feasible | Zero licensing cost; XAMPP for local development; shared hosting ~₹2-3K/yr |
| Operational | ✓ Feasible | Simple UI, no specialized training needed, 24×7 availability |
Hardware & Software Specifications
Software Requirements
| Component | Specification |
|---|---|
| Operating System | Windows 10 / Linux / macOS |
| Web Server | Apache (XAMPP / WAMP / LAMP) |
| Language | PHP 7.4+ |
| Database | MySQL 5.7+ |
| Frontend | HTML5, CSS3, JS, Bootstrap |
| Browser | Chrome, Firefox, Edge (latest) |
| IDE | VS Code / Sublime Text / PHPStorm |
Hardware Requirements (Development)
| Component | Minimum | Recommended |
|---|---|---|
| Processor | Intel Core i3 | Intel Core i5 or higher |
| RAM | 4 GB | 8 GB or more |
| Storage | 250 GB HDD | 512 GB SSD |
| Display | 1024×768 | 1920×1080 (Full HD) |
System Design & Modules
The system contains 3 core modules:
Admin Module
Manage products, view orders, track users, update categories, handle deliveries and order status.
Products Module
Store product names, images, prices, categories, subcategories, availability and discount info.
User Module
Register, login, browse products, add to cart, manage wishlist, checkout, view order history.
Database Structure (Tables)
users
| Field | Type | Description |
|---|---|---|
user_id | INT PK AI | Unique user ID |
username | VARCHAR(50) | User's name |
email | VARCHAR(100) | User's email (unique) |
password | VARCHAR(255) | Hashed password |
created_at | DATETIME | Registration date/time |
products
| Field | Type | Description |
|---|---|---|
product_id | INT PK AI | Unique product ID |
product_name | VARCHAR(100) | Product name |
description | TEXT | Product description |
price | DECIMAL(10,2) | Selling price |
image | VARCHAR(255) | Image path/URL |
stock | INT | Available stock quantity |
category | VARCHAR(50) | Product category |
cart & orders (summary)
| Table | Key Fields |
|---|---|
| cart | cart_id, user_id (FK), product_id (FK), quantity, added_at |
| orders | order_id, user_id (FK), order_date, total_amount, status |
| order_items | item_id, order_id (FK), product_id (FK), quantity, price |
| admin | admin_id, username, password (hashed) |
Process Logic — Key Workflows
GUI Screens Implemented
The following pages are part of the system:
Testing
System testing was performed across three dimensions: code efficiency, optimization, and validation. All 12 test cases passed.
| Test ID | Module | Description | Status |
|---|---|---|---|
| TC001 | Registration | Valid registration inputs | Pass |
| TC002 | Registration | Invalid email format | Pass |
| TC003 | Login | Correct credentials | Pass |
| TC004 | Login | Wrong password error | Pass |
| TC005 | Booking/Order | Valid order placement | Pass |
| TC006 | Booking | Invalid date rejection | Pass |
| TC007 | Payment | Successful payment flow | Pass |
| TC008 | Feedback | Submit feedback after order | Pass |
| TC009 | Admin | Add new product | Pass |
| TC010 | Security | SQL injection attempt blocked | Pass |
| TC011 | Performance | Page loads under 3 seconds | Pass |
| TC012 | Optimization | Code reuse across modules | Pass |
Security Measures
- Authentication & Authorization — Hashed passwords (password_hash/password_verify), role-based access control (Admin/User)
- Session Management — Session timeout, ID regeneration, secure PHP sessions
- SQL Injection Protection — Prepared statements & proper input escaping
- XSS Protection — Output sanitized via htmlspecialchars(); script inputs filtered
- Input Validation — Client-side (HTML5/JS) and server-side (PHP) validation
- Secure File Uploads — File type/size checks; uploaded files stored in protected folders
- HTTPS — SSL certificate for encrypted data transfer in production
- Admin Panel Security — Restricted access, hidden URL, session-controlled entry
Cost Estimation
| Component | Estimated Cost (INR) |
|---|---|
| Domain & Hosting | ₹2,000 – ₹3,000 / year |
| Development Tools | Free (PHP, MySQL, XAMPP) |
| Design (HTML/CSS/Bootstrap) | Free / Minimal |
| Developer Time (if outsourced) | ₹10,000 – ₹15,000 |
| Testing & Debugging | ₹2,000 (manual) |
| Maintenance & Updates | ₹1,000 – ₹2,000 / year |
| Total (Professional) | ₹15,000 – ₹20,000 |
| Total (Student / Self) | ₹2,000 – ₹5,000 |
Future Scope
- Payment gateway integration (UPI, Debit/Credit Card, Net Banking)
- Advanced admin dashboard with analytics and performance reports
- Mobile-responsive design with Bootstrap or PWA
- Product search and filters (price, category, rating)
- Email/SMS notifications for orders and promotions
- User reviews and star ratings for products
- Inventory auto-alerts for low stock
Conclusion
The project "Online Shopping Website Using PHP and MySQL" successfully demonstrates a dynamic, user-friendly, and secure e-commerce platform. Using open-source technologies (PHP + MySQL), it is cost-effective and easy to implement. The system covers the full e-commerce lifecycle — from registration and product browsing to cart management, order placement, and admin control.
This project bridges theoretical knowledge with real-world application and provides a strong foundation for future enhancements including payment gateways, analytics dashboards, and mobile optimization.