A complete event registration system with a clean HTML/CSS/JavaScript frontend and PHP backend.
- User Registration - Create new accounts with validation
- User Login - Secure authentication with password hashing
- Session Management - localStorage-based session handling
- User Dashboard - View personal event registrations
- Event Listing - Browse all available events
- Event Registration - One-click registration for events
- Registration History - View all registered events
- Duplicate Prevention - Prevent multiple registrations for same event
- Responsive Design - Works on desktop, tablet, and mobile
- Clean UI - Modern design with Poppins font
- Real-time Feedback - Success/error messages for all actions
- Dynamic Navigation - Changes based on login status
- Form Validation - Client-side and server-side validation
- PHP Backend - RESTful API endpoints
- MySQL Database - Relational database with proper constraints
- CORS Support - Proper headers for API communication
- Error Handling - Comprehensive error handling throughout
- Security - Password hashing, SQL injection prevention
- Frontend: HTML5, CSS3, Vanilla JavaScript
- Backend: PHP 8+
- Database: MySQL
- Server: PHP Built-in Development Server
- Styling: Google Fonts (Poppins), Custom CSS
- PHP 8.0 or higher
- MySQL (MAMP recommended for macOS)
- Web browser
- Start MAMP and ensure MySQL is running on port 8889
- Create database and tables using the provided schema:
CREATE DATABASE event_registration;
-- Use the database.sql file for complete schema
- Update database credentials in
config/config.php
:
define('DB_HOST', '127.0.0.1');
define('DB_NAME', 'event_registration');
define('DB_USER', 'root');
define('DB_PASS', 'root');
- Start the PHP development server:
php -S 127.0.0.1:8000
- Access the application at:
http://127.0.0.1:8000/index.html
event-registration-backend/
├── api/ # PHP API endpoints
│ ├── create_event.php # Create new events
│ ├── db.php # Database connection
│ ├── list_events.php # Get all events
│ ├── login.php # User authentication
│ ├── my_registrations.php # Get user registrations
│ ├── register.php # User registration
│ └── register_event.php # Event registration
├── config/
│ └── config.php # Database configuration
├── database.sql # Database schema
├── index.html # Landing page
├── register.html # User registration form
├── login.html # User login form
├── events.html # Event listing and registration
├── my-registrations.html # User dashboard
└── styles.css # Application styles
POST /api/register.php
- Create new user accountPOST /api/login.php
- User authentication
GET /api/list_events.php
- Get all eventsPOST /api/register_event.php
- Register for an eventPOST /api/my_registrations.php
- Get user's registrationsPOST /api/create_event.php
- Create new event (admin)
id
- Primary keyfull_name
- User's full nameemail
- Unique email addressphone
- Phone number (optional)password
- Hashed passwordrole
- User role (user/admin)created_at
- Registration timestamp
id
- Primary keytitle
- Event titledescription
- Event descriptionlocation
- Event locationevent_date
- Event date and timecreated_by
- Foreign key to users tablecreated_at
- Creation timestamp
id
- Primary keyuser_id
- Foreign key to users tableevent_id
- Foreign key to events tableregistered_at
- Registration timestamp- Unique constraint on (user_id, event_id)
- Register: Create a new account at
/register.html
- Login: Sign in at
/login.html
- Browse Events: View available events at
/events.html
- Register for Events: Click "Register for Event" on any event
- View Registrations: Check your registrations at
/my-registrations.html
- ✅ Password hashing using PHP's
password_hash()
- ✅ SQL injection prevention with prepared statements
- ✅ Email uniqueness validation
- ✅ Duplicate registration prevention
- ✅ Input validation and sanitization
- ✅ CORS headers for API security
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
MIT License - feel free to use this project for learning and development.
Built with ❤️ by DevObaloluwa