Server-side Starter Tutorial:The Contact Form - Part 1 of 6

Everybody needs one of these!

Every web site (just about) provides some means for visitors to communicate with the web site operators or owners. Direct e-mail links are common, but are not overly convenient for visitors who use or prefer to use web-based mail software. HTML e-mail forms are an improvement but only work with the right combinations of browser, visitor operating system, etc.

We need a contact form that works for every visitor! And what works for every visitor is a php contact form, since it does not rely on a particular browser, nor does it rely on the visitor having a particular e-mail client or operating system, etc.

We already know how to do some of this!

Since we learned lots about accepting data from forms (and constructing messages and using e-mail from php) in the Tell-a-Friend tutorial, the contact form handler (our php script-to-be) will be pretty straightforward, and not introduce too many new ideas/code bits.

The basic contact form we'll use for this exercise will feature the following:

Apart from those inputs to be used by our site visitor, we'll also add the IP address of the visitor and the time that the message was sent. We'll use php directly to acquire that information.

  next  »  

Site Links

 

Starter Tutorials