O'Reilly logo

Web Development Recipes, 2nd Edition by Chris Johnson, Mike Weber, Chris Warren, Brian P. Hogan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Recipe 19Building a Simple Contact Form

Problem

Websites—even mostly static websites—should provide a way for visitors to contact the site’s owner. An email address isn’t always good enough; it’s not inviting or engaging for the user, and it makes it harder for the site owner to sort and organize messages that come from visitors. Sites should have an easy, intuitive way for visitors to get in touch.

Our current website has no way to contact us, and we’re concerned that we’ve missed out on potential business opportunities as a result. Our manager wants us to create a simple form that sends us an email.

Ingredients

  • A server running PHP

Solution

A contact form lets visitors email us without having an email client configured, making it more likely ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required