How To Build a PHP Contact Form

The definitive guide to PHP

Hi friends,

Welcome to the definitive guide to php course.

PHP is a fantastic language, and, in this course, I want to show you how to get started by creating a working, production ready contact form.

I will take a very practical approach by building out the contact form from scratch, but at the same time implement some complex concepts like variables, loops and storing the data in a MySQL database and then using that information to create an email which will then send off the information through a mail server to my inbox.

This course is ideal if you wanted to get into programming but got stuck along the way. Either because every time you work through a tutorial you fail to see how it fits together in the bigger scheme, or because you just never got to understand how you would apply variables and loops in the real world.

That is the aim, I want to show you how this all translates back to the real world and hopefully spark that aha moment in your journey.

All the video courses are accompanied by in-depth articles on this website where the full source code is available with additional commentary.

Without further ado, lets get coding!

PHP Course Overview

We will be building a working PHP contact form using phpmailer, mysql, boostrap and the PDO driver.

Click here to watch the tutorial trailer.

How to build a contact form - Part 1 Logo

Building a PHP contact form - Part 1

In this tutorial I will show you how to build a production ready and secure PHP contact form with the ability to send an email to you when it is filled in.

Click here for the part 1 article and PHP source code.

How to build a contact form - Part 2 Logo

Building a PHP contact form - Part 2

In part 2 we will be adding the phpMailer library to our contact form to use an external email server to handle the emails.

Click here for the part 2 article and PHP source code.

How to build a contact form - Part 3 Logo

Building a PHP contact form - Part 3

Part 3 of the building a PHP contact form from scratch series is where we will introduce PDO and MySQL to our contact form to store the requests for later use.

Click here for the part 3 article and PHP source code.

How to build a contact form - Part 4 Logo

Some articles you might also be interested in...

Sonoff SNZB-02 Zigbee Temperature & Humidity Sensor
Sonoff SNZB-02 Zigbee Temperature & Humidity Sensor

Enclosed in the same shell, SNZB-02 Zigbee temperature & Humidity sensor reports back every couple of minutes. The sensor is powered by CR2450 3V battery. The extra capacity means that the sensor will last a really long time. I have a heater connected to eWeLink app and, once I added a hub (absolutely required) this thing has performed well. The heater is controlled within +- 1°C. That's another thing, eWeLink only provides temperature readings in °C with no option for °F. I'm thinking about placing another sensor on the outside of the window so that I can control based on outdoor temperature as well.

Read The Article
A smart bulb that works with the eWelink app
A smart bulb that works with the eWelink app

The Sonoff lightbulbs are very affordable and provide you with the basic functionality that a smart home needs. If the budget is tight and you don’t need all bells and whistles of the more expensive lights, Sonoff lightbulbs will do the job just fine. The prices start from $9.90 for the (plastic, White + color temperature) B02 B A60 and $12.90 for the fancy, pear-shaped B02-F-ST64 (glass, retro look, White + color temperature). As far as connected lights go, the prices are very attractive and Sonoff lightbulbs indeed are as inexpensive as you can get.

Read The Article
An affordable VPN that also comes with a Geo Blocker
An affordable VPN that also comes with a Geo Blocker

The internet is full of restrictions, censorship, privacy invasions, security breaches, and a host of unwanted entities trafficking in your personal data. Using a VPN is a great first step toward protecting your privacy online. Privacy is fundamental to a well-functioning society because it allows norms, ethics, and laws to be safely discussed and challenged. Without privacy, a free and open society can neither flourish nor exist.

Read The Article