ProjectsPro· 240 min read

Project: Dynamic Website

Build a complete dynamic, database-driven website with PHP — the capstone before Laravel makes it all easier.

What you will learn

  • Combine every PHP skill
  • Add login with sessions
  • Produce a real, multi-page app

The brief

Build a complete dynamic site — a blog, a small store, or a directory — with PHP and MySQL.

  • Multiple pages sharing a header/footer.
  • A database with at least two related tables.
  • Full CRUD on the main resource (PDO + prepared statements).
  • A simple login using sessions, protecting the admin pages.
  • Server-side validation and htmlspecialchars escaping everywhere.
  • Clean, organised files (config, includes, pages).

Tackle this capstone in stages — build the public site first, then add the login that protects the admin actions. A clear order keeps a big project manageable:

  1. Plan the database: design at least two related tables (for example posts and users) and write a config.php that opens a PDO connection.
  2. Lay out the shell: build header.php and footer.php and include them on every page so the whole site shares one layout.
  3. Build the public pages: list the main resource and a single-item detail page, each reading from the database with prepared SELECT queries.
  4. Add full CRUD: create the add, edit and delete scripts for the main resource, every query using prepared statements and every form server-side validated.
  5. Add login with sessions: make a login form that checks the user, then session_start() and store the logged-in user in $_SESSION; add a logout that calls session_destroy().
  6. Protect the admin pages: at the top of each create/edit/delete script, check $_SESSION for a logged-in user and redirect to the login page if it is missing.
  7. Harden and tidy: escape all output with htmlspecialchars(), confirm no SQL is built by string-joining, and organise files into config, includes and pages.

Note: This is the same flow real sites follow: build the data and pages, wrap the dangerous actions (create/update/delete) behind a login, then lock everything down. Steps 5–6 are exactly the auth process from the sessions lesson applied to a whole app.

Note: When you finish, you will have built a full dynamic site by hand. Next, Laravel gives you all of this — routing, database, auth, templates — in a fast, elegant framework. You will appreciate exactly what it does for you.

✍️ Practice

  1. Build the dynamic site meeting all six requirements.
  2. Add a login that protects the create/edit/delete pages.

🏠 Homework

  1. Write a short README describing your app’s pages, database tables and features.
Want to learn this with a mentor?

CodingClave runs guided, project-based training (28-day, 45-day & 6-month batches).

Explore Training →