How To Become A Programmer Without A Degree & Experience

A Contact Form with PHP

【PHP】How to Develop a Contact Form with Validation



In this video, we’re going to create “Contact Form” with PHP!
Every website has a contact form, but you may have no idea how it works.

Actually, the structure is very simple.
Get input values, validate them, and send an email. That’s it!

As always, I’ll show you every step in the video.

You will learn:

  • HTML & CSS
    • Bootstrap & Google Fonts
  • PHP
    • POST method
    • mail function
    • Validation


Hope you enjoy coding!

You may not be able to use mail function on localhost. If it doesn’t work, upload a PHP file to your web server.


MAMP / PHP version 7.1.19
Text Editor Coda2
Browser Google Chrome


Sample Code