A modern, full-featured food ordering website built with PHP, MySQL, HTML, CSS, and JavaScript. Features a stunning UI with smooth animations and complete e-commerce functionality.
- π User Authentication - Secure login/registration with password hashing
- π Browse Menu - View all available food items with categories
- π Search & Filter - Find food by name or category
- π Shopping Cart - Add/remove items, update quantities
- π³ Place Orders - Complete order process with order confirmation
- π Order History - View all past orders and their status
- β Cancel Orders - Cancel pending orders
- π± Responsive Design - Works perfectly on all devices
- π Dashboard - Overview of orders, users, revenue
- β Add Food Items - Add new dishes to the menu
- ποΈ Delete Food Items - Remove items from menu
- π¦ Manage Orders - View all orders and update status
- π Order Status - Change order status (Pending, Preparing, Delivered, Cancelled)
- π¨ Modern gradient UI with glassmorphism effects
- β¨ Smooth animations using AOS (Animate On Scroll)
- π Beautiful color schemes and hover effects
- πΈ Real food images (placeholders - replace with your own)
- π― Clean, intuitive navigation
- XAMPP/WAMP/MAMP or any local server with PHP and MySQL
- PHP 7.4 or higher
- MySQL 5.7 or higher
# Clone or download this project to your htdocs folder
# Example: C:/xampp/htdocs/foodify/- Start Apache and MySQL in XAMPP
- Open phpMyAdmin (http://localhost/phpmyadmin)
- Create a new database named
food_ordering_db - Import the SQL file:
- Go to the database
- Click "Import" tab
- Choose
food_ordering_db.sqlfile - Click "Go"
Edit includes/db_connect.php if your database credentials are different:
define('DB_HOST', 'localhost');
define('DB_USER', 'root');
define('DB_PASS', '');
define('DB_NAME', 'food_ordering_db');Place your food images in the assets/images/ folder. Default images needed:
- pizza1.jpg, pizza2.jpg, pizza3.jpg
- burger1.jpg, burger2.jpg, burger3.jpg
- dessert1.jpg, dessert2.jpg, dessert3.jpg
- salad1.jpg, salad2.jpg
- pasta1.jpg, pasta2.jpg
- wings.jpg, mozzarella.jpg
Pro Tip: Download free food images from:
- Unsplash: https://unsplash.com/s/photos/food
- Pexels: https://www.pexels.com/search/food/
User Interface: http://localhost/foodify/
Admin Panel: http://localhost/foodify/admin/dashboard.php
- URL: http://localhost/foodify/admin/dashboard.php
- Password: admin123
Create your own account through the registration page!
foodify/
β
βββ index.php # Home page
βββ about.php # About us page
βββ contact.php # Contact page
βββ menu.php # Food menu page
βββ cart.php # Shopping cart
βββ order.php # Order history
βββ order_confirmation.php # Order success page
βββ login.php # User login
βββ register.php # User registration
βββ logout.php # Logout handler
β
βββ add_to_cart.php # Add item to cart (AJAX)
βββ update_cart.php # Update cart quantity (AJAX)
βββ remove_from_cart.php # Remove from cart (AJAX)
βββ clear_cart.php # Clear entire cart (AJAX)
βββ place_order.php # Place order (AJAX)
βββ cancel_order.php # Cancel order (AJAX)
βββ get_cart_count.php # Get cart item count (AJAX)
β
βββ /admin
β βββ dashboard.php # Admin dashboard
β βββ add_food.php # Add/manage food items
β βββ view_orders.php # View/manage orders
β βββ admin_logout.php # Admin logout
β
βββ /assets
β βββ /css
β β βββ style.css # Main stylesheet
β βββ /js
β β βββ script.js # JavaScript functionality
β βββ /images
β βββ (food images) # Food item images
β
βββ /includes
βββ db_connect.php # Database connection
βββ header.php # Header template
βββ footer.php # Footer template
- id, name, email, password, created_at
- id, name, category, description, price, image_url, created_at
- id, user_id, food_id, quantity, added_at
- id, user_id, total_price, status, created_at
- id, order_id, food_id, quantity, price
- id, name, email, message, created_at
Edit assets/css/style.css - look for the :root section:
:root {
--primary: #ff6b6b;
--secondary: #4ecdc4;
--gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}Edit includes/header.php and change "Foodify" to your desired name.
Edit menu.php and admin/add_food.php to add more food categories.
- Frontend: HTML5, CSS3, JavaScript (ES6+)
- Backend: PHP 7.4+
- Database: MySQL
- Libraries:
- AOS (Animate On Scroll)
- Font Awesome 6
- Google Fonts (Poppins)
- Make sure JavaScript is enabled
- Check browser console for errors
- Verify AJAX endpoints are accessible
- Ensure images are in correct folder
- Check file paths in database
- Verify image file names match database entries
- Verify MySQL is running
- Check database credentials in
db_connect.php - Ensure database exists
- Clear browser cache and cookies
- Try logging in again with password: admin123
- Change admin password in production!
- Use HTTPS in production environment
- Add proper email functionality for order confirmations
- Implement payment gateway for real transactions
- Add more security measures (CSRF protection, input validation)
- Real-time order tracking
- Email notifications
- Payment gateway integration
- Rating and review system
- Loyalty points program
- Multiple delivery addresses
- Coupon/promo code system
- Dark mode toggle
This project is open source and available for educational purposes.
Created with β€οΈ by @kaifansariw
Enjoy your food ordering website! πππ°