[WordPress] Setting up Wordpress locally and using a custom form with PHP

Profile Picture
- Published on Mar 31, 2020馃審 Public

1 hour total prior to this video:

Helping a friend setup forms on their website.

Essentially, they have some simple HTML forms, they want to be able to record basics like email address, etc.

They have a Wordpress site, but the forms they have listed are in a custom php file.

When collecting email addresses, especially for a mailing list, I'd highly recommend sending those emails directly to the email list provider. Importing emails manually from your local email list can cause spam issues. However, if you're simply responding to one-off emails collected from the form, these types of solutions can work.

Prior to the video I downloaded MAMP and local Wordpress.

Also all of these languages/tools/frameworks are new to me (or very rusty), so I show the process of how I tackle each problem.

I end up showing two ways to collect forms:

  • Using Wordpress plugins
  • Writing directly to the database using PHP

We want to set this up on a local environment to experiment. We need to be very careful about modifying anything on production, as that can cause issues for a customer.

Ideally we have version control and a deploy process setup. In this case, I'm manually editing files.

0:00 - 32:00

  • Installing MAMP locally
  • Accessing the MAMP virtual machine
  • Configuring the localhost port
  • Accessing phpMyAdmin

32:00 - 54:00

  • Installing Wordpress
  • Overriding FTP plugin installs (modify locally)
  • Add write permission to entire Wordpress setup to bypass FTP plugin install

54:00 - 1:19:00

  • Installing and exploring Contact Form 7
  • Adding the shortcode to a Wordpress page
  • Troubleshooting email configuration
  • Adding Flamingo DB support

1:19:00 - 1:45:00

  • Setting up a custom DB table
  • Creating a simple form in PHP
  • Posting the results of the form to another page
  • Inserting the results of the form into the DB
  • Troubleshooting variable interpolation