A fully functional web-based Q&A platform similar to Stack Overflow, built with PHP, MySQL, and Bootstrap.
- User registration and authentication
- Secure password hashing
- User profiles with statistics
- Session management
- Post questions with title, description, and category
- View question details
- Track question views
- Like/upvote questions
- Category-based filtering
- Related questions display
- Post answers to questions
- Like/upvote answers
- Answer sorting by likes
- Multiple answers per question
- Responsive design with Bootstrap 5
- AJAX-based like system
- Real-time notifications
- Clean and modern interface
- Mobile-friendly layout
- 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
- XAMPP (or any PHP + MySQL environment)
- Web browser
- Text editor (VS Code recommended)
- Download and install XAMPP from https://www.apachefriends.org/
- Start Apache and MySQL services from XAMPP Control Panel
git clone https://github.com/HarshadaPatilS/Question-Answer-Platform.gitOr download ZIP and extract to C:\xampp\htdocs\qa-platform\
- Open phpMyAdmin (http://localhost/phpmyadmin)
- Create a new database named
qa_platform - Import the
database/setup.sqlfile- Click on the
qa_platformdatabase - Go to "Import" tab
- Choose
setup.sqlfile - Click "Go"
- Click on the
Open config/database.php and update if needed:
private $host = "localhost";
private $db_name = "qa_platform";
private $username = "root";
private $password = "";
private $port = "4306";- Open your browser
- Navigate to
http://localhost/qa-platform/ - Sign up for a new account or use demo credentials:
- Username: john_doe
- Password: password
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
- 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
- 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
- Clone the repository
- Set up local environment
- Import database
- Configure settings
- Start development
POST /questions/like_question.php- Like a questionPOST /answers/like_answer.php- Like an answerPOST /answers/post_answer.php- Submit answer