A comprehensive role-based student management system with separate dashboards for Admin, Teacher, and Student roles. Built with PHP, MySQL, and Bootstrap 5.
- Features Overview
- Quick Setup Guide
- Project Structure
- Database Schema
- Technology Stack
- User Workflows
- UI Features
- Security Features
- Troubleshooting
- Support
- Email-based login with password verification
- Role-based signup for teachers and students
- Pre-created admin account (no signup available)
- Password hashing with bcrypt (PASSWORD_DEFAULT)
- Automatic role-based redirects after login
- Session-based authentication with role verification
- Dashboard: View statistics (departments, courses, teachers, students count)
- Department Management: Add/delete departments with duplicate checking
- Course Management: Add/delete courses linked to departments
- Course Assignment: Assign courses to teachers (department-based filtering)
- Cross-Department Offerings: Offer courses from one department to another
- Teacher Management: View all registered teachers with contact details
- Student Management: View all registered students in table format
- Dashboard: View all assigned courses with quick action buttons
- My Courses: List of courses assigned by admin
- Mark Attendance: Select course and date, mark students present/absent
- Add Marks: Enter marks for quizzes, assignments, mid-term, final exams
- Edit/Delete Marks: Modify or remove previously entered marks
- View Students: See list of students enrolled in each course
- Dashboard:
- 4 stat cards (enrolled courses with 5-limit, present count, absent count, attendance %)
- Course cards showing course name and teacher name
- Real-time attendance updates
- Enroll Courses:
- Enroll in department courses
- View cross-department offered courses
- Maximum 5 courses enrollment limit
- Unenroll option
- My Attendance:
- View attendance records by course
- Attendance percentage with visual progress bar
- Warning if attendance < 75%
- Date-wise attendance tracking
- My Marks:
- View marks for all assessment types
- Progress bars for each mark
- Overall performance tracking
- Open phpMyAdmin in your browser:
http://localhost/phpmyadmin/ - Click "New" to create a database
- Name it:
student_system - Select collation:
utf8mb4_general_ci - Click "Import" tab
- Choose file:
database_new.sql - Click "Go" to import
- Verify 13 tables are created
Open db.php and verify credentials:
<?php
$conn = new mysqli("localhost", "root", "", "student_system");
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
?>- Start XAMPP Control Panel
- Start Apache and MySQL modules
- Open browser and visit:
http://localhost/student-management-system/ - You'll be redirected to the login page
Email: admin@gmail.com
Password: sami12345
Note: Admin credentials are pre-created in the database. Teachers and students must sign up through the signup page.
student-management-system/
β
βββ admin/ # Admin Dashboard Pages
β βββ dashboard.php # Admin home with stats
β βββ departments.php # Manage departments
β βββ courses.php # Manage courses
β βββ assign_courses.php # Assign courses to teachers
β βββ course_offerings.php # Cross-department offerings
β βββ teachers.php # View all teachers
β βββ students.php # View all students
β
βββ teacher/ # Teacher Dashboard Pages
β βββ dashboard.php # Teacher home with assigned courses
β βββ my_courses.php # List assigned courses
β βββ mark_attendance.php # Mark student attendance
β βββ add_marks.php # Add/edit/delete marks
β βββ view_students.php # View enrolled students
β
βββ student/ # Student Dashboard Pages
β βββ dashboard.php # Student home with stats & courses
β βββ enroll_courses.php # Enroll/unenroll courses (5 max)
β βββ my_attendance.php # View attendance records
β βββ my_marks.php # View all marks
β
βββ db.php # Database connection
βββ index.php # Entry point (redirects to login)
βββ login_new.php # Login page with animations
βββ signup.php # Registration page
βββ logout.php # Logout handler
βββ database_new.sql # Complete database schema
| Table | Description |
|---|---|
roles |
Three roles: admin (id:1), teacher (id:2), student (id:3) |
users |
User authentication (email, password hash, role_id) |
user_profiles |
Common profile data (first/last name, phone, address) |
departments |
Academic departments |
courses |
Course catalog with department association |
teachers |
Teacher-specific data (department, qualifications) |
students |
Student-specific data (enrollment number, department) |
| Table | Description |
|---|---|
teacher_courses |
Courses assigned to teachers by admin |
enrollments |
Student course enrollments |
attendance |
Attendance records (date, status: 1=present, 0=absent) |
assessment_types |
Quiz, Assignment, Mid-term, Final (with max_marks) |
marks |
Student marks (obtained_marks, total_marks) |
exam_uploads |
File uploads for exams |
course_offerings |
Cross-department course offerings |
attendance table:
attendance_date(DATE) - Date of attendancestatus(TINYINT) - 1 for present, 0 for absent
marks table:
obtained_marks(INT) - Marks obtained by studenttotal_marks(INT) - Maximum marks for that assessment
assessment_types table:
max_marks(INT) - Default maximum marks for assessment type
| Category | Technology |
|---|---|
| Backend | PHP 8.2.12 |
| Database | MySQL (via phpMyAdmin) |
| Server | Apache 2.4.58 on XAMPP |
| Frontend | HTML5, CSS3, JavaScript |
| CSS Framework | Bootstrap 5.3.0 |
| Icons | Font Awesome 6.0.0 |
| Fonts | Google Fonts (Inter) |
| Animations | AOS (Animate On Scroll) |
| Security | password_hash(), prepared statements |
-
Sign Up
- Visit signup page
- Select role: "Teacher"
- Enter details and department
- Submit registration
-
Login
- Use email and password
- Auto-redirect to teacher dashboard
-
View Assigned Courses
- Admin assigns courses
- View in "My Courses" page
-
Mark Attendance
- Select course and date
- Mark each student present (1) or absent (0)
- Submit attendance
-
Add Marks
- Select course and assessment type
- Enter marks for each student
- Edit or delete marks as needed
-
Sign Up
- Visit signup page
- Select role: "Student"
- Enter enrollment number and department
- Submit registration
-
Login
- Use email and password
- Auto-redirect to student dashboard
-
Enroll in Courses
- View available courses (own + offered from other departments)
- Click "Enroll" (maximum 5 courses)
- Unenroll if needed
-
Check Attendance
- View attendance by course
- See percentage and warning if < 75%
- Track date-wise attendance
-
View Marks
- See marks for all assessment types
- View progress bars
- Track overall performance
-
Login
- Use pre-created credentials
- Auto-redirect to admin dashboard
-
Manage Departments
- Add new departments
- Delete existing departments
- Duplicate check enabled
-
Manage Courses
- Add courses to departments
- Delete courses
- Link to department
-
Assign Courses
- Select teacher
- View only courses from teacher's department
- Assign course to teacher
-
Cross-Department Offerings
- Select course from one department
- Offer to another department
- Students can see and enroll
-
Monitor System
- View total departments count
- View total courses count
- View all teachers
- View all students
- Gradient Backgrounds: Purple to blue gradient theme
- Animated Features: Floating icons on login page with border glow effects
- AOS Animations: Fade, zoom, slide effects on scroll
- Responsive Design: Mobile-friendly Bootstrap grid
- Card-Based Layouts: Clean card designs for data display
- Progress Bars: Visual attendance and marks representation
- Color-Coded Stats:
- Green for present/good performance
- Red for absent/warnings
- Blue for neutral information
- Hover Effects: Interactive buttons and cards
- Font Awesome Icons: Professional iconography
- Google Fonts: Inter font family for modern look
| Feature | Implementation |
|---|---|
| Password Hashing | password_hash() with PASSWORD_DEFAULT |
| Password Verification | password_verify() on login |
| SQL Injection Protection | Prepared statements with bind_param() |
| Session Management | Session-based authentication |
| Role-Based Access | Role checks on every protected page |
| Input Validation | trim() and validation on all inputs |
| Session Destruction | Proper logout with session_destroy() |
Problem: "Invalid email or password"
Solutions:
- Verify database credentials in
db.php - Check if
student_systemdatabase exists - Confirm admin user exists in
userstable:SELECT * FROM users WHERE email = 'admin@gmail.com';
- Use exact credentials:
admin@gmail.com/sami12345
Problem: "Connection failed" message
Solutions:
# Check MySQL is running
Get-Service | Where-Object {$_.DisplayName -like '*MySQL*'}
# If not running, start XAMPP MySQL
# Open XAMPP Control Panel > Start MySQL
# Test connection
mysql -u root -p
USE student_system;
SHOW TABLES;Problem: "The requested URL was not found on this server"
Solutions:
- Verify files are in:
C:\xampp\htdocs\student-management-system\ - Check Apache is running in XAMPP Control Panel
- Use correct URL:
http://localhost/student-management-system/ - Check
.htaccessif using mod_rewrite
Problem: "session_start(): Session cannot be started after headers"
Solution: This has been fixed. PHP code with session_start() is now at the top of all files before any HTML output.
Problem: "Unknown column 'date'" or "Unknown column 'marks_obtained'"
Solution: All fixed. Current column names:
attendance.attendance_date(notdate)marks.obtained_marks(notmarks_obtained)marks.total_marksassessment_types.max_marks
- Check Database: Verify all 13 tables exist in phpMyAdmin
- Check Connections: Ensure
db.phphas correct credentials - Check Logs:
C:\xampp\apache\logs\error.log - Test Admin Login: Use default credentials first
- Clear Cache: Clear browser cache and try again
- PHP: 8.0 or higher
- MySQL: 5.7 or higher
- Apache: 2.4 or higher
- Browser: Modern browser (Chrome, Firefox, Edge)
Created for educational purposes. Feel free to modify and extend for your needs.
Developed by Sami Khan
β Fully Functional - All features tested and working
- Authentication system β
- Admin dashboard and features β
- Teacher dashboard and features β
- Student dashboard and features β
- Database schema optimized β
- UI/UX polished β
- Security implemented β
- Cross-department offerings β
- 5-course enrollment limit β
- Real-time attendance counters β
- Department-based filtering β
Last Updated: December 17, 2025