A fully functional web-based Q&A platform similar to Stack Overflow, built with PHP, MySQL, and Bootstrap.
Features
User Management
- User registration and authentication
- Secure password hashing
- User profiles with statistics
- Session management
Question Features
- Post questions with title, description, and category
- View question details
- Track question views
- Like/upvote questions
- Category-based filtering
- Related questions display
Answer Features
- Post answers to questions
- Like/upvote answers
- Answer sorting by likes
- Multiple answers per question
Interactive UI
- Responsive design with Bootstrap 5
- AJAX-based like system
- Real-time notifications
- Clean and modern interface
- Mobile-friendly layout
Technologies Used
- Backend: PHP 7.4+
- Database: MySQL 5.7+
- Frontend: HTML5, CSS3, JavaScript
- Framework: Bootstrap 5.3
- Libraries: jQuery 3.6
- Icons: Bootstrap Icons
- Tools: XAMPP, phpMyAdmin, VS Code
Installation Instructions
Prerequisites
- XAMPP (or any PHP + MySQL environment)
- Web browser
- Text editor (VS Code recommended)
Step 1: Setup XAMPP
- Download and install XAMPP from https://www.apachefriends.org/
- Start Apache and MySQL services from XAMPP Control Panel
Step 2: Clone/Download Project
git clone https://github.com/HarshadaPatilS/Question-Answer-Platform.git
Or download ZIP and extract to C:\xampp\htdocs\qa-platform\
Step 3: Database Setup
- Open phpMyAdmin (http://localhost/phpmyadmin)
- Create a new database named
qa_platform
- Import the
database/setup.sql file
- Click on the
qa_platform database
- Go to “Import” tab
- Choose
setup.sql file
- Click “Go”
Open config/database.php and update if needed:
private $host = "localhost";
private $db_name = "qa_platform";
private $username = "root";
private $password = "";
private $port = "4306";
Step 5: Run the Application
- Open your browser
- Navigate to
http://localhost/qa-platform/
- Sign up for a new account or use demo credentials:
- Username: john_doe
- Password: password
Project Structure
qa-platform/
├── config/
│ └── database.php # Database connection
├── includes/
│ ├── header.php # Common header
│ ├── footer.php # Common footer
│ └── functions.php # Helper functions
├── assets/
│ ├── css/
│ │ └── style.css # Custom styles
│ ├── js/
│ │ └── script.js # Custom JavaScript
│ └── images/ # Images
├── auth/
│ ├── login.php # Login page
│ ├── signup.php # Registration
│ └── logout.php # Logout
├── questions/
│ ├── ask_question.php # Create question
│ ├── view_question.php # View details
│ └── like_question.php # Like handler
├── answers/
│ ├── post_answer.php # Submit answer
│ └── like_answer.php # Like handler
├── user/
│ ├── profile.php # User profile
│ └── my_questions.php # User's questions
├── database/
│ └── setup.sql # Database schema
├── index.php # Homepage
└── README.md # Documentation
Database Schema
Tables
- users - User accounts
- questions - Posted questions
- answers - Question answers
- question_likes - Question upvotes
- answer_likes - Answer upvotes
- tags - Question tags (optional)
- question_tags - Question-tag relationships
Usage Guide
For Users
- Register: Create account with username, email, password
- Login: Access your account
- Ask Question: Post new questions with details
- Answer: Help others by answering questions
- Like: Upvote helpful questions and answers
- Profile: View your statistics and activity
For Developers
- Clone the repository
- Set up local environment
- Import database
- Configure settings
- Start development
API Endpoints (AJAX)
POST /questions/like_question.php - Like a question
POST /answers/like_answer.php - Like an answer
POST /answers/post_answer.php - Submit answer










