https://mahesh-langote.github.io/Add-Course-Using-PHP-HTML-CSS-JS/ (Due to PHP Database Connection you will get this error : An error occurred while fetching courses. Please try again later.
An error occurred while fetching courses. Please try again later. )
The project is a simple web application for managing college courses. It allows users to view a list of available courses, add new courses, and enroll in courses. The application is built using HTML, CSS, JavaScript, PHP, and MySQL. Courses are stored in a MySQL database, and PHP is used to handle form submissions and database operations.
- Web server (e.g., Apache, Nginx)
- PHP
- MySQL database server
- Download the project files from the GitHub repository.
- Create a new database in MySQL for the project. You can use phpMyAdmin or any other MySQL management tool.
- Import the
course.sqlfile into the newly created database. This file contains the necessary table structure for the courses. Here's how to import the file using phpMyAdmin:- Open phpMyAdmin and select the database you created.
- Click on the "Import" tab in the top menu.
- Choose the
course.sqlfile using the file selector. - Click the "Go" button to import the file and create the necessary table.
- Place the project files in the document root of your web server (e.g.,
htdocsfor XAMPP orwwwfor WAMP). - Make sure your web server and MySQL server are running.
- Update the database connection parameters in the
save_course.phpfile to match your MySQL server configuration. - Open the
index.htmlfile in your web browser. You should see the list of available courses and be able to add new courses and enroll in them.
- View Courses: On the main page (
index.html), you can view a list of available courses. The courses are fetched from the database and displayed on the page. - Add New Course: To add a new course, click the "+ Add New Courses" button. A form will appear where you can enter the course details (name, description, duration, and image). After filling in the details, click the "Add" button to save the course to the database.
- Enroll in Course: Each course card has an "Enroll Now" button. Clicking this button will display an alert message indicating that you have enrolled in the selected course.
- This is a basic and simplified project for educational purposes. In a real-world scenario, you would need to implement proper security measures and validation for user inputs.
- For production use, consider deploying the application on a secure web server and using proper authentication and authorization mechanisms.