A simple yet comprehensive web-based banking management system built with PHP and MySQL. This project demonstrates core banking functionalities including account management, transactions, card services, and user management.
- Features
- Technologies Used
- Prerequisites
- Installation
- Database Setup
- Project Structure
- Usage
- Screenshots
- Security Features
- Contributing
- License
- Sign Up: Create new user accounts with validation
- Sign In: Secure login with password verification
- Session Management: Secure user sessions
- Profile Management: Update personal information
- Multiple Account Types: Checking and Savings accounts
- Account Overview: View all accounts with balances
- Account Numbers: Auto-generated unique account numbers
- Money Transfers: Transfer funds between accounts
- Deposits: Add money to accounts
- Withdrawals: Withdraw money with balance validation
- Transaction History: View recent transactions on dashboard
- Card Management: View and manage debit/credit cards
- Order New Cards: Request new cards with auto-generated numbers
- Block Cards: Temporarily block cards for security
- Delete Cards: Remove blocked cards permanently
- Feedback System: Submit ratings and comments
- Customer Support: Contact information and FAQ
- Responsive Dashboard: Clean, intuitive user interface
- Backend: PHP 7.4+
- Database: MySQL 5.7+
- Frontend: HTML5, CSS3, JavaScript
- Security: Password hashing, Session management, Input validation
- Database Connection: PDO (PHP Data Objects)
Before running this project, make sure you have:
- Web Server: Apache or Nginx
- PHP: Version 7.4 or higher
- MySQL: Version 5.7 or higher
- XAMPP/WAMP/LAMP: For local development (recommended for beginners)
bash git clone https://github.com/yourusername/banking-system.git cd banking-system
-
If using XAMPP:
- Copy the project folder to htdocs directory
- Start Apache and MySQL services from XAMPP Control Panel
-
If using a live server:
- Upload files to your web hosting directory
- Ensure PHP and MySQL are available
- Create a file named db_connect.php in the root directory: php
sql CREATE DATABASE banking_system; USE banking_system;
Execute the SQL commands from create_database.sql file in your MySQL client or phpMyAdmin:
sql -- Users table CREATE TABLE users ( user_id INT AUTO_INCREMENT PRIMARY KEY, full_name VARCHAR(255) NOT NULL, username VARCHAR(50) UNIQUE NOT NULL, email VARCHAR(255) UNIQUE NOT NULL, phone VARCHAR(20), address TEXT, password VARCHAR(255) NOT NULL, created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP );
-- Accounts table CREATE TABLE accounts ( account_id INT AUTO_INCREMENT PRIMARY KEY, user_id INT, account_type ENUM('Checking', 'Savings') NOT NULL, account_number VARCHAR(11) UNIQUE NOT NULL, balance DECIMAL(11, 2) DEFAULT 0.00, created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, FOREIGN KEY (user_id) REFERENCES users(user_id) );
-- Transactions table CREATE TABLE transactions ( transaction_id INT AUTO_INCREMENT PRIMARY KEY, account_id INT, transaction_type ENUM('Deposit', 'Withdrawal', 'Transfer') NOT NULL, amount DECIMAL(11, 2) NOT NULL, description TEXT, target_account_id INT NULL, transaction_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP, FOREIGN KEY (account_id) REFERENCES accounts(account_id), FOREIGN KEY (target_account_id) REFERENCES accounts(account_id) );
-- Cards table CREATE TABLE cards ( card_id INT AUTO_INCREMENT PRIMARY KEY, user_id INT, card_type ENUM('Debit', 'Credit') NOT NULL, card_number VARCHAR(15) UNIQUE NOT NULL, card_holder VARCHAR(255) NOT NULL, expiry_date VARCHAR(5) NOT NULL, is_blocked BOOLEAN DEFAULT FALSE, FOREIGN KEY (user_id) REFERENCES users(user_id) );
-- Feedback table CREATE TABLE feedback ( feedback_id INT AUTO_INCREMENT PRIMARY KEY, user_id INT, category ENUM('General Feedback', 'Bug Report', 'Feature Request', 'Complaint', 'Compliment') NOT NULL, rating INT CHECK (rating >= 1 AND rating <= 5), comments TEXT, submitted_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, FOREIGN KEY (user_id) REFERENCES users(user_id) );
banking-system/ │ ├── login.php # Login and registration page ├── dashboard.php # Main dashboard ├── accounts.php # Account overview ├── transfers.php # Money transfer functionality ├── deposit.php # Deposit and withdrawal ├── cards.php # Card management ├── feedback.php # Feedback system ├── profile.php # User profile management ├── support.php # Customer support ├── logout.php # Logout functionality ├── db_connect.php # Database connection (create this) ├── create_database.sql # Database schema ├── style.css # Main stylesheet (create this) ├── stylelogin.css # Login page stylesheet (create this) └── README.md # This file
- Visit the login page (login.php)
- Click "Sign Up" to create a new account
- Fill in required information and agree to terms
- After successful registration, sign in with your credentials
- Two default accounts (Checking & Savings) will be created automatically
- Dashboard: View total balance and recent transactions
- Accounts: See all your accounts and balances
- Transfers: Send money to other accounts using account numbers
- Deposit/Withdrawal: Add or remove money from your accounts
- Cards: Manage your debit/credit cards
- Profile: Update personal information
- Feedback: Rate the service and provide comments
- Password Hashing: All passwords are securely hashed using PHP's password_hash()
- SQL Injection Prevention: Uses prepared statements with PDO
- Session Management: Secure session handling for user authentication
- Input Validation: Server-side validation and sanitization
- XSS Protection: HTML special characters are escaped
- Edit style.css for main application styling
- Edit stylelogin.css for login page styling
- The design uses a clean, modern interface with sidebar navigation
The modular structure makes it easy to add new features:
- Create new PHP files for additional functionality
- Add navigation links in the sidebar
- Follow the existing code patterns for consistency
-
Database Connection Error
- Check your database credentials in db_connect.php
- Ensure MySQL service is running
-
Session Issues
- Make sure PHP sessions are enabled
- Check file permissions
-
Styling Issues
- Ensure CSS files are in the correct directory
- Check browser console for any errors
If you encounter any issues or have questions:
- Create an issue in this repository
- Check the troubleshooting section above
- Review the code comments for implementation details
Note: This is a demo banking system for educational purposes. Do not use in production without implementing additional security measures and compliance requirements for real banking applications.
For beginners who want to get started immediately:
- Download XAMPP from https://www.apachefriends.org/
- Install and start Apache and MySQL
- Clone this repository to xampp/htdocs/banking-system
- Open phpMyAdmin (http://localhost/phpmyadmin)
- Create database named banking_system
- Import the SQL from create_database.sql
- Create db_connect.php with your database credentials
- Visit http://localhost/banking-system/login.php
- Sign up and start exploring!
Happy Banking! 🎉