The Travel Form is a web application designed to collect and manage information from students who are interested in participating in a trip. Built using HTML, CSS, and PHP, this application offers a user-friendly interface with a robust back-end database for efficient data handling.
- User Registration Form: A well-designed form capturing essential information such as:
- Name
- Age
- Gender
- Email Address
- Phone Number
- Description of Interest
- Responsive Design: Ensures accessibility on both desktop and mobile devices.
- Database Integration: Submissions are securely stored in a MySQL database.
- Data Validation: PHP scripts check for input accuracy and completeness.
- Error Handling: Friendly error messages guide users to correct input mistakes.
- HTML: For creating the structure of the web form.
- CSS: For styling the application, enhancing the user interface.
- PHP: Handles server-side processing and database interactions.
- MySQL: Stores the submitted data in a structured format.
The application uses a MySQL database named travel_form
with the following table structure:
Column Name | Data Type | Description |
---|---|---|
sno |
INT (Primary Key) | Unique identifier for each trip entry (auto-increment) |
name |
TEXT | Student's full name |
age |
INT | Student's age |
gender |
VARCHAR(8) | Student's gender |
email |
VARCHAR(22) | Student's email address |
phone |
VARCHAR(10) | Student's phone number |
desc |
TEXT | Brief description or interest in the trip |
dt |
DATETIME | Timestamp of the entry (defaults to current timestamp) |
-
Set Up a Local Environment:
- Install a local server environment such as XAMPP, WAMP, or MAMP to set up the necessary components like PHP and MySQL.
-
Create the Database:
- Open your database management tool (like phpMyAdmin).
- Create a new database named
travel_form
.
-
Run SQL Script:
- Execute the SQL dump provided in the
database.sql
file to create thetrip
table and insert example data.
- Execute the SQL dump provided in the
-
Configure Database Connection:
- Update it with your database connection details:
$servername = "localhost"; // usually "localhost" $username = "your_username"; // typically "root" for local development $password = "your_password"; // your database password $dbname = "travel_form"; // name of the database you created
- Update it with your database connection details:
-
Access the Application:
- Place all project files in the
htdocs
folder of your server (e.g., XAMPP). - Open your web browser and navigate to:
http://localhost/path_to_your_project/index.php
- Place all project files in the
-
Filling Out the Form:
- Navigate to the form in your web browser.
- Enter the required fields (marked with an asterisk).
- Ensure the information is accurate.
-
Submitting the Form:
- Click the “Submit” button.
- The application will display any errors if the input is invalid, guiding you to correct mistakes.
-
Data Management:
- You can view all submitted trip entries through phpMyAdmin or implement an admin panel for data management in future enhancements.
Enhancements to consider for future development:
- Email Notifications: Notify students upon successful submission of the form.
- Admin Dashboard: Implement an interface for administrators to manage submissions (view, edit, delete).
- File Uploads: Allow students to upload relevant documents like medical forms or parental consent.
- User Authentication: Implement user login and authentication for better security and data management.