Lab 5 - Contact Form

Goals of the exercise

  • Understand how an Apache, MySQL, PHP (AMP) environment works.
  • Learn to integrate PHP into an existing HTML/CSS portfolio.
  • Learn to build and submit HTML forms (POST method).
  • Learn to store submitted form data in a MySQL database.
  • Understand basic security practices for form handling (validation, sanitizing).
  • Create both a working contact form and a “messages overview” admin page.
  • Learn how to publish your project and database to an online hosting environment.
icon new tab Go to the solution
preview picture lab5

Description

In this exercise, you must add a working contact form to your portfolio using PHP and MySQL. You create a database, integrate the provided PHP code, and make the form store messages in the database. After sending a message, users see a thank you page, and you have a private page to view all messages. Finally, you upload everything to your hosting account and make sure the online version works.

Related links

Reflection

  • Waaw!

    Implementing the form on my contact page was quite easy.

  • Aauuw!

    I wanted to add checkboxes to my form the right way.

  • Not sure?

    I found it quite difficult to give my contact form a decent style.