A PHP based hotel room management system with secure authentication and CRUD operations.
username:
devMeekpassword:meek1025bitLong
- Admin Authentication System
- Room Management (CRUD Operations)
- Secure Session Management
- CSRF Protection
- Responsive Bootstrap UI
- Input Validation
- Activity Logging
- PHP 8.2+
- MySQL/MariaDB
- Apache Web Server (XAMPP for Windows)
- Clone the repository
git clone https://github.com/yourusername/hotel_management.git
cd hotel-management-system- Import the database schema
CREATE DATABASE hotel_management;
USE hotel_management;
CREATE TABLE rooms (
id INT AUTO_INCREMENT PRIMARY KEY,
type VARCHAR(255) NOT NULL,
price DECIMAL(10, 2) NOT NULL,
status ENUM('Available', 'Occupied') NOT NULL
);
CREATE TABLE AdminUsers (
id INT AUTO_INCREMENT PRIMARY KEY,
username VARCHAR(255) NOT NULL UNIQUE,
password VARCHAR(255) NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);- Update database configuration in dbconnect.php:
<?php
private $host = 'localhost';
private $db_name = 'hotel_management';
private $username = 'your_username';
private $password = 'your_password';- Create necessary directories:
mkdir logs
chmod 777 logs- Configure your web server to point to the public directory.
INSERT INTO AdminUsers (username, password)
VALUES ('admin', '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi');
-- Default password: admin123curl -X POST http://yourdomain.com/hotel_management/public/api/add_admin.php -d "secret=007tOPVictoriasSecret&username=admin&password=admin123"hotel_management/
├── app/
│ ├── controllers/ # Application controllers
│ ├── models/ # Database models
│ ├── utils/ # Utility classes
│ └── views/ # View templates
├── config/ # Configuration files
├── public/ # Public directory
│ ├── api/ # API endpoints
│ ├── css/ # Stylesheets
│ └── js/ # JavaScript files
└── logs/ # Application logs- Password Hashing using
password_hash() - CSRF Protection
- SQL Injection Prevention using PDO
- XSS Protection
- Session Management
- Input Validation
- Secure Password Storage
- Username:
devMeek - Password:
meek1025bitLong
Secret Key:
007tOPVictoriasSecret(For API)

