diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..87b46a6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,36 @@ +# Database credentials and configuration +includes/dbconn.php + +# Environment variables +.env +.env.local + +# IDE and editor files +.vscode/ +.idea/ +*.swp +*.swo +*~ + +# OS files +.DS_Store +Thumbs.db +desktop.ini + +# Backup files +*.bak +*.backup +*.sql + +# Logs +*.log +error_log + +# Temporary files +tmp/ +temp/ +cache/ + +# Uploaded files (configure based on your needs) +# uploads/* +# !uploads/.gitkeep diff --git a/README.md b/README.md new file mode 100644 index 0000000..aa3e0a2 --- /dev/null +++ b/README.md @@ -0,0 +1,122 @@ +# Tourism Website - TourOnline + +A tourism website showcasing travel destinations in Sri Lanka with user authentication, favorites, and reviews. + +## Project Structure + +```text +WebAssignment/ +├── api/ # Backend PHP endpoints +│ ├── about.php # Statistics API +│ ├── category.php # Category data API +│ ├── contact.php # Contact form handler +│ ├── content.php # Place details & interactions +│ ├── home.php # Homepage data API +│ ├── login.php # Authentication API +│ ├── phpvariables.php # Session management +│ └── search.php # Search API +├── css/ # Stylesheets +│ ├── common.css # Common styles +│ └── navbar.css # Navigation styles +├── js/ # JavaScript files +│ ├── log.js # Login/logout functionality +│ └── navbar.js # Navigation effects +├── includes/ # Shared PHP includes +│ └── dbconn.php # Database connection +├── img/ # Images and icons +├── placeImg/ # Tourist destination images +├── devImg/ # Developer team photos +├── about.html # About page +├── category.html # Browse by category +├── contact.html # Contact form +├── content.html # Place details page +├── explore.html # Sri Lanka map explorer +├── home.html # Homepage +├── login.html # Login/register page +└── search.html # Search functionality +``` + +## Features + +- **User Authentication**: Login and registration system +- **Browse Destinations**: Explore places by category, popularity, or recent additions +- **Interactive Map**: Click on Sri Lankan provinces to explore locations +- **Search**: Find destinations by name +- **User Interactions**: Like, favorite, and comment on places +- **Statistics Dashboard**: View site statistics (users, places, visits, reviews) + +## Technologies Used + +- **Frontend**: HTML5, CSS3, Vanilla JavaScript +- **Backend**: PHP +- **Database**: MySQL +- **AJAX**: XMLHttpRequest for async operations + +## Setup Instructions + +1. **Database Configuration**: + - Import your database schema + - Update database credentials in `includes/dbconn.php` + +2. **Web Server**: + - Requires PHP-enabled web server (Apache/Nginx) + - Place files in web root directory + - Ensure proper file permissions + +3. **Access**: + - Navigate to `home.html` in your browser + - Default page loads homepage with featured destinations + +## Security Notes + +⚠️ **Important**: This project contains security vulnerabilities that should be addressed before production use: + +1. **SQL Injection**: Use prepared statements instead of direct query concatenation +2. **Password Storage**: Implement password hashing (bcrypt/Argon2) +3. **XSS Protection**: Add output escaping and input sanitization +4. **CSRF Protection**: Implement CSRF tokens for forms +5. **Configuration**: Move database credentials to environment variables + +## Database Tables + +- `users` - User accounts +- `places` - Tourist destinations +- `placeimg` - Place images +- `category` - Place categories +- `comments` - User reviews +- `favplace` - User favorites +- `likeplace` - Place likes +- `visits` - Site visit tracking +- `contact` - Contact form submissions + +## Pages Overview + +- **home.html**: Homepage with favorite/liked/viewed/recent places +- **explore.html**: Interactive Sri Lanka map +- **category.html**: Browse places by category +- **search.html**: Search destinations +- **content.html**: Detailed place view with images and reviews +- **about.html**: Site statistics and information +- **contact.html**: Contact form +- **login.html**: User authentication + +## Recent Improvements + +- Organized files into logical folders (api/, css/, js/, includes/) +- Removed duplicate and unused files +- Consolidated navigation menus +- Improved project structure and maintainability + +## Future Enhancements + +- Implement prepared statements for SQL queries +- Add password hashing +- Implement responsive design improvements +- Add admin panel for content management +- Implement proper session security +- Add API rate limiting +- Implement caching mechanisms + +## License + +This project is for educational purposes. diff --git a/about.html b/about.html index 94c5c67..e450026 100644 --- a/about.html +++ b/about.html @@ -1,394 +1,440 @@ - -
- - - + + + +• What is the purpose of this website?
-Our development team is undergraduates studying at NSBM this website is the product of a - web assessment we have done
-• What is the purpose of this website?
++ Our development team is undergraduates studying at NSBM this website + is the product of a web assessment we have done +
• What is the vision of this website?
-To become an online platform for all kinds of tourists to find the places they love - according to their preferences
-• What is the vision of this website?
• Why does this website user interface look trashy?
-The website is at the development stage and limited time to develop a website - from scratch but as we planned over time this website's look and features will be matched today's - standards
-+ To become an online platform for all kinds of tourists to find the + places they love according to their preferences +
• What do you mean by the development stage? -
-
As planned we could not complete the website at the given time as we desire but that - does not mean there is no space for future development that's why we mean this website is still in - the - development stage and we can't say this final product also
-• Why does this website user interface look trashy?
• What are the services offered?
-At the development stage, we currently offer a limited number of information about - places In the future we are planned to add services like booking hotels, hiring cabs, etc
-+ The website is at the development stage and limited time to develop + a website from scratch but as we planned over time this website's + look and features will be matched today's standards +
• Is this free to use?
-For now and future this will be free to use, But in the future, we planned to show - advertisements
-• What do you mean by the development stage?
+• How many countries or places are covered by this website?
-At this stage, our only focus is Sri Lanka although we only covered a few places for now -
-+ As planned we could not complete the website at the given time as we + desire but that does not mean there is no space for future + development that's why we mean this website is still in the + development stage and we can't say this final product also +
+• What are the services offered?
++ At the development stage, we currently offer a limited number of + information about places In the future we are planned to add + services like booking hotels, hiring cabs, etc +
+• Is this free to use?
++ For now and future this will be free to use, But in the future, we + planned to show advertisements +
• Is it possible to have a booking using the website?
-At this stage no but we already planned to add a booking service on the website
-+ • How many countries or places are covered by this website? +
+ At this stage, our only focus is Sri Lanka although we only covered + a few places for now +
+• Is it possible to have a booking using the website?
++ At this stage no but we already planned to add a booking service on + the website +
+