Loading
Cybersecurity undergraduate and web developer based in Sri Lanka, passionate about penetration testing, VAPT, and ethical hacking.
Full company website for Dreamway Education — responsive design, PHP backend, contact form with mail integration, and SEO-optimised pages.
Dreamway Education Pvt Ltd is an education consultancy based in Ratnapura, Sri Lanka. This project involved designing and developing a full website from scratch using PHP and MySQL — covering course listings, student inquiry forms, an admin dashboard, and dynamic content management. The goal was a clean, professional web presence that reflects the institution's academic focus.
The project started with gathering requirements from the client. Key deliverables were identified:
A sitemap and wireframe were produced before any code was written to align with the client's expectations early in the process.
The MySQL database was designed around four core tables. The schema was kept normalised to avoid data redundancy:
-- Courses table
CREATE TABLE courses (
id INT AUTO_INCREMENT PRIMARY KEY,
title VARCHAR(255) NOT NULL,
description TEXT,
duration VARCHAR(100),
fee DECIMAL(10,2),
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
-- Inquiries table
CREATE TABLE inquiries (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(255) NOT NULL,
email VARCHAR(255) NOT NULL,
phone VARCHAR(20),
course_id INT,
message TEXT,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (course_id) REFERENCES courses(id)
);
Additional tables were created for blog_posts and
admin_users with hashed passwords using
password_hash() — never plain text.
The backend was built using plain PHP with a simple MVC-style structure separating config, models, and views:
/dreamway
/config
db.php -- PDO connection
/includes
header.php
footer.php
/admin
dashboard.php
courses.php
inquiries.php
/pages
index.php
about.php
courses.php
contact.php
All database queries use PDO with prepared statements to prevent
SQL injection. Form inputs are sanitised with
htmlspecialchars() before output to prevent XSS.
The student inquiry form on the contact page submits via POST to a handler that validates input, inserts to the database, and sends a confirmation email using PHPMailer:
// Validate and sanitise input
$name = htmlspecialchars(trim($_POST['name']));
$email = filter_var($_POST['email'], FILTER_VALIDATE_EMAIL);
// Insert to DB using prepared statement
$stmt = $pdo->prepare(
"INSERT INTO inquiries
(name, email, phone, course_id, message)
VALUES (?, ?, ?, ?, ?)"
);
$stmt->execute([$name,$email,$phone,$course,$message]);
// Send confirmation via PHPMailer
$mail->setFrom('noreply@dreamwayedu.lk');
$mail->addAddress($email);
$mail->Subject = 'Inquiry Received — Dreamway Education';
$mail->send();
The admin also receives a notification email for every new inquiry submitted through the site.
A protected admin panel was built behind session-based authentication. Login is restricted to registered admin users only:
// Login handler
session_start();
$stmt = $pdo->prepare(
"SELECT * FROM admin_users WHERE email = ?"
);
$stmt->execute([$email]);
$user = $stmt->fetch();
if ($user && password_verify($password, $user['password'])) {
$_SESSION['admin'] = $user['id'];
header('Location: dashboard.php');
}
From the dashboard, the admin can add, edit, and delete courses, view and respond to student inquiries, and publish blog posts. All admin pages check for a valid session before rendering.
The frontend was built with custom CSS using a mobile-first approach. No CSS frameworks were used — all layouts are built with Flexbox and CSS Grid to keep the codebase lightweight:
/* Responsive course grid */
.courses-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
gap: 2rem;
padding: 2rem 0;
}
/* Mobile breakpoint */
@media (max-width: 768px) {
.nav-links { display: none; }
.nav-links.open { display: flex; flex-direction: column; }
}
JavaScript was used only for the mobile navigation toggle and form validation — keeping the page fast with no heavy dependencies.
password_hash() — never store plain textmail() for transactional emailPHP 8 — backend logic and routingMySQL — relational database with PDOPHPMailer — inquiry and notification emailsHTML5 / CSS3 — semantic markup and responsive layoutJavaScript — mobile nav toggle and client-side validationApache — web server with .htaccess URL rewritingVS Code — development environment